Repository navigation
Conversation
omp keeps the keys it signed in with in ~/.omp/agent/agent.db, not in an auth.json, so the collector never found an omp user's key and showed "Waiting for auth" for an account that is signed in. It is read there now, read-only, passing over a key omp disabled, and under PI_CODING_AGENT_DIR when that moves omp's tree, as pi's already is. The older auth.json stays as the last fallback.
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryThe Ollama Cloud collector now reads omp’s saved API key from
Static review and whitespace checks found no actionable issues. Tests were not run during this review.
|
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.
omp keeps the keys it signs in with in
~/.omp/agent/agent.db(auth_credentials,credential_type = 'api_key'), not in anauth.json, so the collector never found an omp user's Ollama Cloud key and showed "Waiting for auth" for an account that is signed in.It is read from there now:
disabled_causeset), newest first;PI_CODING_AGENT_DIRwhen that variable moves omp's tree, as it already does for pi'sauth.json— omp reads only the moved tree then, so the moved database replaces the default rather than sitting beside it;~/.omp/agent/auth.jsonkept as the last fallback.The rest of the order is unchanged:
OLLAMA_API_KEY, thenapiKeyin~/.config/omarchy/agents/ollama.json, then pi'sauth.json.Carried over from #16085, which was written against #14040's branch and auto-closed when that branch was merged and deleted. The credit-plan balance that PR also carried is already here through the base's
/api/balancereading, so this is only the key lookup now.Tests:
agent-usage-ollama-scanner-test.shgains two cases — the key fromagent.dbwith a disabled row and another provider's row passed over (found ahead of anauth.jsonkey), and the database underPI_CODING_AGENT_DIR. Both fail withomp_database_key()taken out; with it, all 47 cases pass.The same
~/.omp/agent/auth.jsonlookup is in the DeepSeek, MiniMax, OpenCode, OpenRouter and Z.ai collectors, so an omp user's key for those isn't found either. Kept to Ollama here; a shared reader incollectors.pywould cover all six if you'd rather fix it once.