[Bounty proposal] fix(cli): escape resource IDs in Rich markup success messages ($30 proposed)
Description
In several CLI commands (action_item.py, conversation.py, goal.py, memory.py, local.py), the output success messages rely on ctx.renderer.success() which uses the Rich library to parse markup.
Currently, resource IDs returned from the API or local database are directly interpolated inside Rich formatting tags like:
ctx.renderer.success(f"Updated action item [bold]{action_item_id}[/bold].")
If an action_item_id (or memory ID, goal ID, etc.) happens to contain a bracket pattern like [tag] or [/bold], it will cause rich.errors.MarkupError and crash the CLI command when attempting to print the success message. This is an unescaped markup injection vulnerability.
Proposed Fix
Use from rich.markup import escape to escape the variables before interpolation, as is currently correctly done in auth.py.
For example:
ctx.renderer.success(f"Updated action item [bold]{escape(str(action_item_id))}[/bold].")
I have a fix ready and will submit a PR linking to this issue.
This is the same bug class as #17344/#15976, and is already fixed for all 10 argv-sourced IDs by #17343 (merged as 28ebb966a4) — action_item.py, conversation.py, goal.py, and memory.py all wrap IDs with rich.markup.escape now. Closing as resolved.