feat(openrouter): multi labeled API-key token accounts (port 0.45 #2271)#225
Closed
Finesssee wants to merge 1 commit into
Closed
feat(openrouter): multi labeled API-key token accounts (port 0.45 #2271)#225Finesssee wants to merge 1 commit into
Finesssee wants to merge 1 commit into
Conversation
…eipete#2271) Enable labeled OpenRouter API keys via token accounts, prefer the active token-account key over stored api_keys, and add usage --account selection.
|
This repository allows each user to open at most 4 pull requests per 7 days. Closing this automatically. |
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
Port upstream CodexBar 0.45 #2271: enable multiple labeled OpenRouter API keys via the existing token-account switcher.
Changes
OPENROUTER_API_KEYenv injection,sk-or-v1-...placeholder).build_fetch_contextprefers the active token-account key over a storedapi_keys.jsonvalue so account switching is not shadowed by a default key.FetchContext.api_keyfirst — no provider logic change required.codexbar account ... openrouterworks via support catalog;usageinjects the active (or--accountlabel/index) key for env-backed token accounts.--accountlookup, and FetchContext precedence (token vs stored).Stacked multi-account cards remain the existing token-account UI; no new stacked-card surface was added.
Commands run
cargo test --manifest-path rust/Cargo.toml openrouter_cargo test --manifest-path rust/Cargo.toml test_token_account_supportcargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml fetch_context_openrouterNotes
ed8c5cef)Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.