omi icon indicating copy to clipboard operation
omi copied to clipboard

Python CLI config success output crashes on Rich markup in profile names or values

Open JayyBG opened this issue 2 months ago • 1 comments

At current main, omi config persists user-controlled profile names and config values, then interpolates those strings directly into Rich markup passed to Renderer.success(). A value containing an unmatched Rich closing tag can therefore make an otherwise successful config mutation terminate with rich.errors.MarkupError after the file has already been changed.

Examples of affected call sites in sdks/python-cli/omi_cli/commands/config.py include:

ctx.renderer.success(f"Active profile: [bold]{name}[/bold].")
ctx.renderer.success(f"Deleted profile [bold]{name}[/bold].")
ctx.renderer.success(f"Set [bold]{key}[/bold] = {display_value} on profile [bold]{profile.name}[/bold].")

Minimal Rich-level reproduction of the generated output shape:

from rich.console import Console
Console().print("Active profile: [bold][/bold][/bold].")
# rich.errors.MarkupError: closing tag '[/bold]' ... doesn't match any open tag

Because profile use creates a brand-new profile name without restricting Rich markup characters, this is reachable with local CLI input and does not require a live Omi account. The config save happens before the success message, so the command can report failure even though it already changed persistent state.

Expected behavior: arbitrary profile names / config values should be rendered literally in status output; presentation markup owned by the CLI should remain styled.

I can submit a focused AI-assisted fix with regression coverage that escapes only user-controlled fragments (rather than disabling intentional Rich styling globally). I searched the open issues for profile/config Rich markup and did not find an overlapping report.

Following the contribution guide's invitation to propose small bounties, @josancamon19 would you consider US$5 via the documented private PayPal claim process after acceptance and merge for this fix and tests? No bounty approval or payment is assumed. Payment details will remain private.

JayyBG avatar Sep 07 '26 22:09 JayyBG

Follow-up after merge: the fix for this report was accepted and merged as #12977. 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