microsoft / microsoft/amplifier
[amplifier-app-cli] Rich markup error when session resume error contains path-like strings
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.1k
- Forks
- 261
- Avg merge
- 3h 28m
- Merged PRs (30d)
- 13
Description
Problem
When amplifier session resume fails, the error message is printed using Rich markup without escaping user data:
console.print(f"[red]Error resuming session:[/red] {exc}")
If the error message contains path-like strings (e.g., /Users/foo/bar), Rich interprets [/Users] as a closing markup tag and crashes:
rich.errors.MarkupError: closing tag '[/Users]' at position 48 doesn't match any open tag
This masks the actual error, making debugging difficult.
Locations
amplifier_app_cli/commands/session.pyline 514amplifier_app_cli/commands/session.pyline 1086
Both have the same pattern.
Suggested Fix
from rich.markup import escape
# ...
console.print(f"[red]Error resuming session:[/red] {escape(str(exc))}")
Reproduction
- Trigger any session resume error that includes a macOS path in the exception message
- Observe Rich crashes instead of showing the actual error
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in amplifier_app_cli/commands/session.py at lines 514 and 1086, where session resume errors are printed, and reproduce the failure with an exception containing a macOS-style path. Done means both locations display the original error without a Rich MarkupError; the issue does not name a test file to run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100