Skip to content

Fix memory alert message formatting#97

Merged
lukifer23 merged 1 commit intomasterfrom
codex/update-memory-alert-message-format
Sep 23, 2025
Merged

Fix memory alert message formatting#97
lukifer23 merged 1 commit intomasterfrom
codex/update-memory-alert-message-format

Conversation

@lukifer23
Copy link
Owner

Summary

  • build a single human-readable memory usage message before constructing alerts
  • reuse the formatted message for both warning and critical alerts so logs include the numbers
  • add unit coverage verifying the alert message and log contents

Testing

  • pytest tests/test_memory_monitor.py

https://chatgpt.com/codex/tasks/task_e_68d1c2a925248323987cc30c138d0835

Copilot AI review requested due to automatic review settings September 23, 2025 13:39
@lukifer23 lukifer23 merged commit 743330b into master Sep 23, 2025
1 check failed
@lukifer23 lukifer23 deleted the codex/update-memory-alert-message-format branch September 23, 2025 13:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link

Copilot AI Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
alert = MemoryAlert(
alert_type='warning',
message=".1f",
message=usage_message,
Copy link

Copilot AI Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the critical alert, this line was previously '.1f' which is clearly a corrupted format string. The fix correctly uses usage_message.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants