omi icon indicating copy to clipboard operation
omi copied to clipboard

Python CLI Rich status messages crash on markup-like profile names

Open JayyBG opened this issue 2 months ago • 3 comments

Several Python CLI status/error messages interpolate user-controlled profile names or config values directly into Rich markup strings. A profile name such as bad[/bold] can make otherwise successful commands fail while rendering their message, after the config or auth state has already been changed.

Examples of affected surfaces on current main include:

  • omi config profile use 'bad[/bold]'
  • omi config set local_api_url 'http://127.0.0.1/[oops]' --profile 'bad[/bold]'
  • omi auth logout --profile 'bad[/bold]'
  • omi auth refresh --profile 'bad[/bold]' error details for API-key profiles
  • local command task status messages that include task IDs

Expected behavior: CLI-owned Rich styling should remain available, but dynamic user/API fragments should be escaped before interpolation so commands render literally and preserve JSON/stdout contracts.

Proposed scope: escape only the dynamic fragments in these status/error messages and add focused regression tests using the existing Python CLI test fixtures. This is AI-assisted work from @JayyBG. Would maintainers consider a small US$5 PayPal bounty after acceptance and merge? No award is assumed, and payout details would be shared privately only if approved.

JayyBG avatar Sep 08 '26 09:09 JayyBG

Implemented in PR #13159 — auth status messages now escape user-controlled profile/provider fragments with rich.markup.escape, matching config.py. Regression test: logout with a bad[/bold] profile name exits cleanly (fails without the fix).

Nofates avatar Sep 08 '26 16:09 Nofates

For maintainer context: #13088 was opened earlier today and already covers this issue more broadly (auth + config status fragments plus the shared pretty-mode Renderer.error() boundary), with six focused regressions including preservation of raw JSON error details. It has also had end-to-end verification in the maintainer review thread. #13159 appears to overlap the auth-status subset, so flagging the existing broader PR to avoid duplicate-review confusion.

JayyBG avatar Sep 08 '26 18:09 JayyBG

Follow-up after merge: the broader fix for this report was accepted and merged as #13088. Could a human maintainer please confirm or decline the proposed US$5 PayPal bounty now that the contribution is merged? No award or payment is assumed; any payout details will be provided privately only if approved.

JayyBG avatar Sep 09 '26 23:09 JayyBG