fix(config): stop reporting broken configs and unknown profiles as "no API token" - #87
Merged
Merged
Conversation
…o API token" Resolve() discarded Load()'s error, so a malformed or unreadable config.json, and a -p naming a profile that doesn't exist, all surfaced as "no API token configured. Set OMNI_API_TOKEN, use --token, or run `omni config init`" — advice that sends the caller to re-authenticate when the real fix is a typo or a corrupt file. - An unknown -p (or an unknown defaultProfile) now errors immediately, naming the config path and listing the available profiles. - A config file that exists but fails to load is reported as such whenever the config is actually needed; when --token and --base-url are both given the file is still ignored. A missing file remains the silent, normal case. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ei8UYaG1bW5PJhk93EaqzA
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.
config.Resolvedidcfg, _ := Load(), so three unrelated failures all produced the same message — "no API token configured. Set OMNI_API_TOKEN, use --token, or runomni config init":omni -p typo models listconfig.jsonNow:
A missing config file is still silent (env/flags may carry everything), and a broken file is ignored when both
--tokenand--base-urlare supplied. Tests added for both paths.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ei8UYaG1bW5PJhk93EaqzA