Python CLI config mutations emit empty stdout in JSON mode
Summary
The Python CLI documents --json as machine-readable output available for any command, but the mutating omi config commands currently exit successfully with empty stdout in JSON mode.
Affected commands in sdks/python-cli/omi_cli/commands/config.py:
omi --json config set KEY VALUEomi --json config profile use NAMEomi --json config profile delete NAME --yes
Each mutation calls only ctx.renderer.success(...) after saving. Renderer.success() deliberately returns immediately when json_mode is enabled, so no JSON payload is emitted.
This differs from read-only config commands (config show, config path, config profile list), which call renderer.emit(...), and from resource create/update commands, which emit their API result after the success message.
Source-level reproduction
The output contract in sdks/python-cli/README.md says:
Pass
--jsonto any command ... to get machine-readable output
and omi_cli/output.py describes JSON mode as:
machine-readable JSON to stdout
But the mutation path is:
cfg.save(config)
ctx.renderer.success(...)
while Renderer.success() contains:
def success(self, message: str) -> None:
if self.json_mode:
return
Therefore a successful JSON-mode mutation has no stdout document for a caller to parse.
No live Omi service, credentials, or user data are required to reproduce this; these commands operate on local configuration.
Expected behavior / proposed scope
Preserve the current pretty-mode success messages, but emit a small structured acknowledgement in JSON mode after each successful mutation. For example:
config set→{"success": true, "profile": "default", "key": "api_base", "value": "..."}(withlocal_tokenmasked or omitted)profile use→{"success": true, "active_profile": "work"}profile delete→{"success": true, "deleted_profile": "old-account"}
Focused regression tests should invoke the real Typer commands with an isolated temporary config and verify:
- stdout is valid JSON after each successful mutation;
- the config file contains the requested mutation;
local_tokenis never exposed in JSON output;- pretty-mode behavior remains unchanged;
- declined deletion still performs no mutation.
I searched open Omi issues for the config/profile JSON-output case before filing and did not find a matching report. This is related in shape to the successful resource-delete JSON-output issue, but it affects a separate local-config command family.
Following the contribution guide's documented “No Bounties Available?” process, @josancamon19 @kodjima33: would you approve a US$10 bounty for an accepted and merged focused fix with regression coverage, payable through the documented private PayPal claim process? This is a proposal, not an assumed award or reservation; payment details will remain private.
AI disclosure: this source-level investigation and report were prepared by OpenAI GPT-5.6 Sol acting with the connected GitHub account owner's authorization. I am available to discuss the report and revise or implement the fix after maintainer scope/bounty confirmation.
Opened PR #13531. Config mutations emit JSON in --json mode.