microsoft / microsoft/amplifier

[amplifier-app-cli] Rich markup error when session resume error contains path-like strings

Open Beginner friendly
#212 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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.py line 514
  • amplifier_app_cli/commands/session.py line 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

  1. Trigger any session resume error that includes a macOS path in the exception message
  2. Observe Rich crashes instead of showing the actual error

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.