Repository navigation
Conversation
|
Solid fix — verified end-to-end, no blocking issues from my side. sdks/python-cli/omi_cli/commands/config.py — the inline check from #19689 is extracted into Verification: I ran the full sdks/python-cli pytest suite on the PR head in a clean environment with the project's pinned dependencies — 907 passed, 1 skipped, including the 9 new cases. USER IMPACT: with a bad --api-base, $OMI_API_BASE, or stale saved API base, commands now fail immediately with "Invalid URL for 'api_base'" instead of ~5s of retries ending in "Connection failed" — or worse, a false warning that a write "may have been applied" when no request ever left the machine. One non-blocking observation: Everything I'd want as a reviewer is already here: failure matrix per source, regression tests, and a clear before/after. Nothing further requested. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
5/5 confidence bug fix (clear root cause, fix(cli) title, tests, CI green) but mergeStateStatus is DIRTY (real merge conflict, not stale) -- hard floor blocks merge and rebasing/force-pushing the branch is off-limits. Approved, left for a future clean re-sync.
`omi config set api_base` checks URLs since BasedHardware#19689, but the value a command actually uses can also come from --api-base, $OMI_API_BASE, or a config saved before that check, and none of those are checked. httpx raises UnsupportedProtocol for `localhost:8000` or `ftp://...`, which the client treats as a transport failure: reads retry for several seconds and end in "Connection failed" (exit 3), and writes report "POST outcome unknown: the server may have applied this write", though nothing left the machine. The config set check is now a shared helper, and make_client runs it on the resolved API base, so every source fails fast with the same "Invalid URL for 'api_base'" usage error.
91e48bf to
15537ae
Compare
|
Since my last review: addressed (rebase onto current main is clean — config.py is byte-identical to the approved commit, and the main.py/test_config.py deltas vs that commit are exactly the timeout/ConfigWriteRefused work main already carries, so no new logic rode along; full sdks/python-cli suite re-run at the new head: 929 passed, 1 skipped) · still open (nothing from my prior review) · newly introduced (nothing). Verdict: this remains correct and merge-ready from my side; the rebase changed nothing in the fix itself.
Verification: full sdks/python-cli pytest suite at head 15537ae in a clean environment — 929 passed, 1 skipped, zero failures. kodjima33's approval predates the rebase, but the net diff is unchanged, so it still reflects this code. USER IMPACT: a bad --api-base, $OMI_API_BASE, or stale saved base now fails instantly with "Invalid URL for 'api_base'" instead of ~5s of retries ending in "Connection failed" — or a false warning that a write "may have been applied" when no request ever left the machine. Still on my wishlist, non-blocking: by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
What's wrong
#19689 made
omi config set api_baserefuse malformed URLs. The value a command actually uses can also come from--api-base,$OMI_API_BASE, or a config saved before that check, and none of those are checked:httpx raises
UnsupportedProtocolfor a scheme-less or non-http base, which is aTransportError, so the client treats it as a network failure. Reads retry with backoff and end in "Connection failed". Writes are worse: the client reports that the server may have applied the write, although no request ever left the machine.omi --json --api-base api.omi.me memory listConnection failed, exit 3Invalid URL for 'api_base', exit 1omi --json --api-base localhost:8000 memory create helloPOST outcome unknown: the server may have applied this write, exit 3Invalid URL for 'api_base', exit 1OMI_API_BASE=ftp://api.omi.me omi --json goal delete g1 --yesDELETE outcome unknown, exit 3Invalid URL for 'api_base', exit 1--api-base https://api.staging.omi.meChange
config set's URL check moves intovalidated_url(key, value)incommands/config.py(same rules, same message), andAppContext.make_clientruns it on the resolved API base. Every source of the base now fails fast with the same usage error. Profile management (config show,config set) still loads a bad saved value, so it can be fixed.Tests
tests/test_config.py: "a malformed API base is refused before any request", 9 cases (localhost:8000,ftp://api.omi.me,http://example.test:abc× flag / env / saved config) running--json memory create hello. Each expects exit 1, empty stdout, the usage error on stderr and no "outcome unknown". All 9 fail on main and pass after. The #19689config settests pass unchanged, and so does the full CLI suite.Failure-Class: none