feat(cli): render final replies with markdown emphasis - #9482
Conversation
|
This looks awesome |
a6bb9e8 to
525b019
Compare
|
Additional verification note: I reran The change-specific verification for this PR still passes: the focused CLI/prompt tests pass, and |
|
Thanks for the PR @LeonSGP43 — the code quality here is genuinely solid. The skin engine integration, the ANSI fallback, the numeric highlighting regex with proper negative lookahead for paths/versions, and the thorough test coverage all show real care. Unfortunately we have to close this for the same reason we closed PR #601, which attempted the same Rich Markdown rendering approach. The core issue is our CLI's output pipeline: Our CLI runs inside prompt_toolkit's Your screenshot looks great because macOS Terminal is the happy path (native truecolor). But we need this to work everywhere our users run the CLI. There's also a design concern with the prompt hint change — reversing the CLI from "avoid markdown" to "encourage compact markdown" changes agent output behavior for all CLI users at once, which is a bigger decision than the rendering layer. This is tracked as Issue #504 (Enhanced CLI TUI) and is planned as a phased core change that addresses the prompt_toolkit integration, terminal compatibility detection, streaming output, and graceful degradation together. When we get there, your approach of theming the Markdown renderable with the skin engine palette is a good foundation we'll likely draw from. Appreciate the contribution and the detailed testing notes. |
What does this PR do?
This PR improves final assistant reply readability in the Hermes CLI by rendering safe final replies as terminal-friendly markdown instead of flat plain text.
Scope is intentionally narrow:
User-facing impact:
Related Issue
N/A
Type of Change
Changes Made
cli.pythrough Rich markdown when the response is safe to treat as markdown, while preserving ANSI fallback behavioragent/prompt_builder.pyto encourage compact markdown when it improves terminal readabilityhermes_cli.mainimport in recent session display so the history path stays lightweightHow to Test
Run Hermes in the CLI and use this prompt:
Confirm that:
Run local verification:
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
python -m pytest tests/cli/test_cli_init.py tests/cli/test_stream_delta_think_tag.py tests/cli/test_resume_display.py tests/agent/test_prompt_builder.py -q -k 'AssistantResponseRenderable or show_history or resume_without_target_lists_recent_sessions or platform_hints_known_platforms or cli_platform_hint_encourages_compact_markdown_only_for_cli'->7 passed in 30.95spython -m pytest tests/e2e/ -v --tb=short->48 passed in 21.29spython -m pytest tests/ -qstill does not pass locally on macOS 26.3.1 after rebasing ontoorigin/main:13 failed, 2957 passed, 5 skipped, 128 warnings in 395.30sorigin/mainworktree in the same local environment:17 failed, 3828 passed, 5 skipped, 124 warnings in 466.85s