Skip to content

fix: disable Rich markup parsing to prevent MarkupError - #127

Open
ksn135 wants to merge 1 commit into
madroidmaq:mainfrom
ksn135:fix-rich-markup-error
Open

ksn135 wants to merge 1 commit into
madroidmaq:mainfrom
ksn135:fix-rich-markup-error

Conversation

@ksn135

@ksn135 ksn135 commented Jul 19, 2026

Copy link
Copy Markdown

Fixes MarkupError when log messages contain square brackets (e.g. from Hermes Agent Desktop).

Problem:
RichHandler attempts to parse text like [OUT-OF-BAND USER MESSAGE] as Rich markup, causing:

rich.errors.MarkupError: closing tag '[/OUT-OF-BAND USER MESSAGE]' doesn't match any open tag

Solution:
Explicitly set markup=False in RichHandler initialization.

Testing:

  • Verified with Hermes Agent Desktop — no more MarkupError.

Summary by CodeRabbit

  • Bug Fixes
    • Logging messages now display their text literally, preventing unintended formatting or markup interpretation.

Hermes Agent Desktop sends messages with square brackets
(e.g. [OUT-OF-BAND USER MESSAGE]). RichHandler with default
settings attempts to parse these as Rich markup, causing
MarkupError. Explicitly set markup=False to treat log
messages as plain text.
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d17897c8-735c-49fa-8758-bffaf21ac2b7

📥 Commits

Reviewing files that changed from the base of the PR and between 4f8e9ef and 8d9b1ab.

📒 Files selected for processing (1)
  • src/mlx_omni_server/utils/logger.py

📝 Walkthrough

Walkthrough

The Rich logging handler in get_logger() now disables markup interpretation for log messages.

Changes

Logging behavior

Layer / File(s) Summary
Rich handler markup configuration
src/mlx_omni_server/utils/logger.py
Sets RichHandler.markup to False, preventing log message text from being interpreted as Rich markup.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: disabling Rich markup parsing to avoid MarkupError.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ksn135

ksn135 commented Jul 19, 2026

Copy link
Copy Markdown
Author

IMPORTANT: This is a quick fix, but not the correct one.
The proper solution is to expose logger configuration (disabling markup) as a command-line parameter, e.g. --no-markup.
Happy to submit a PR if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant