Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes memory alert message formatting by building a human-readable memory usage message that is reused for both warning and critical alerts. The change ensures logs include actual memory usage numbers instead of malformed messages.
- Replaced corrupted message strings with properly formatted usage messages
- Added comprehensive test coverage to verify alert message content and log output
- Consolidated message formatting logic to avoid duplication between warning and critical alerts
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| azchess/utils/memory_monitor.py | Fixed corrupted alert messages and added usage_message formatting logic |
| tests/test_memory_monitor.py | Added unit test to verify alert message formatting and log content |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| alert = MemoryAlert( | ||
| alert_type='critical', | ||
| message=".1f", | ||
| message=usage_message, |
There was a problem hiding this comment.
The original message was '.1f' which appears to be a corrupted format string. The fix correctly uses usage_message, but this suggests there may have been a systematic issue with message formatting that should be verified across the codebase.
| alert = MemoryAlert( | ||
| alert_type='warning', | ||
| message=".1f", | ||
| message=usage_message, |
There was a problem hiding this comment.
Similar to the critical alert, this line was previously '.1f' which is clearly a corrupted format string. The fix correctly uses usage_message.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68d1c2a925248323987cc30c138d0835