Repository navigation
Conversation
kodjima33
approved these changes
Sep 24, 2026
kodjima33
left a comment
Collaborator
There was a problem hiding this comment.
Bug fix: omi config set accepted invalid URL schemes/empty tokens, corrupting config.toml. Root cause stated, scoped diff, thorough regression tests, confirmed not fixed on main. 5/5.
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validates URL schemes for
api_baseandlocal_api_urland ensures non-empty values forlocal_tokeninomi config set.Problem & Root Cause
In
sdks/python-cli/omi_cli/commands/config.py,set_value()accepted arbitrary strings for profile configuration keys without validation:api_baseorlocal_api_urlto invalid schemes (e.g.ftp://...), missing hosts (http://), or non-URL strings wrote corrupt values into~/.omi/config.toml, causing subsequent CLI commands to fail with unhandledhttpx.InvalidURLor connection errors.local_tokento an empty string or whitespace was silently saved.https://api.omi.me/),profile.api_basewas saved withrstrip("/")but the success message and--jsonresponse emitted the unstripped input string.Fix
urlsplitvalidation forapi_baseandlocal_api_url, rejecting schemes other thanhttporhttpsand URLs without a host with a descriptiveUsageError.local_token.display_valueand JSON output to report the exact normalized stored value.tests/test_config.pywith 18 parameterized test cases verifying invalid URL rejection, valid URL normalization, and whitespace token rejection.Verification
pytest tests/test_config.py: 69 passed, 2 skippedpytest: 528 passed, 2 skippedblack --checkandisort --check: cleanProposed Bounty
[email protected]