Python CLI local status unwraps a structured Desktop failure as a normal result
Report
At commit 2654b4dc9bb9e5277a5db567214a674c092d2fd8, the Desktop status failure path can cross the Python CLI's local response boundary without raising a CLI error.
desktop/macos/Desktop/Sources/Providers/ChatToolExecutor.swiftreturns a JSON string containing"ok": false,"database_available": false, and a failure message when reading local status throws.LocalAgentAPIServer.toolResponserecognizes the text prefixError:, but wraps this JSON string in an HTTP 200 envelope with outer"ok": true.sdks/python-cli/omi_cli/local_client.py::_unwrap_tool_responsechecks only that outer envelope. It then parses the inner JSON and returns the failed status as an ordinary result. The local status command emits that result without checking the inner failure.
This is related to the error-boundary topic in #13012 and the SQL text-prefix case in #12983, but concerns the structured JSON status-failure path.
Reproduction
After installing the CLI, the focused boundary reproduction is:
import json
from omi_cli.local_client import _unwrap_tool_response
failure = {
"ok": False,
"database_available": False,
"screen_history_available": False,
"message": "Failed to read local Omi status: test",
}
print(_unwrap_tool_response({
"ok": True,
"name": "get_local_status",
"content_type": "text/plain",
"result": json.dumps(failure),
}))
# Returns the failure dictionary; no CliError is raised.
I executed the three unchanged production unwrapping/parsing functions extracted with Python AST, using synthetic payloads and a stand-in exception class because the CLI dependencies are not installed in this environment. The wrapped failure returned normally; an outer ok: false control raised; a wrapped success returned normally. The three source files were also verified against the pinned commit above. This verifies the parsing boundary only: I have not run the complete CLI, a live Desktop instance, or repository preflight, and do not claim an end-to-end reproduction.
Proposed paid scope
Following the contribution guide's invitation to propose bounties, @josancamon19: would you consider US$100 via the documented private PayPal claim process after acceptance and merge for a focused fix and regression coverage?
The proposed scope is to make the status-failure path produce a nonzero CLI error with useful diagnostics, while preserving successful structured status responses and ordinary tool data. Implementation should avoid blindly treating arbitrary user-data dictionaries containing an error key as transport failures. Coverage would include human/JSON output and the real CLI command with mocked transport, plus required component tests and preflight before a PR.
Please confirm whether this scope is wanted, whether overlapping work exists, and what cash amount you can approve before implementation. US$100 is a negotiable proposal, not an existing project reward or an assumed payment.
AI disclosure: this investigation and proposal were prepared by OpenAI Codex on behalf of @Kgruben0133 with the account owner's authorization. No production credentials or real user data were used. Payment details would be shared privately only if needed for an approved award.
Implemented in PR #13157 — _unwrap_tool_response now detects an ok: false mapping after unwrapping the embedded result and raises CliError with the Desktop's failure message. Two regression tests included (fail without the fix).