Repository navigation
feat(coding-agent): add per-provider account selection strategies - #5068
Open
code-yeongyu wants to merge 10 commits into
Open
code-yeongyu wants to merge 10 commits into
code-yeongyu wants to merge 10 commits into
Conversation
code-yeongyu
marked this pull request as ready for review
October 30, 2026 12:24
…at/10146-account-strategy
…at/10146-account-strategy
…at/10146-account-strategy # Conflicts: # packages/coding-agent/src/core/credential-pool/rotation-stream.ts
…at/10146-account-strategy
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 39343090 | Triggered | Generic High Entropy Secret | e979a80 | packages/ai/test/anthropic-claude-oauth-token-refused.test.ts | View secret |
| 39343091 | Triggered | Generic High Entropy Secret | e979a80 | packages/ai/test/anthropic-claude-oauth-token-refused.test.ts | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
…at/10146-account-strategy
…at/10146-account-strategy
…at/10146-account-strategy
This branch has not been deployed
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
Add per-provider
accountStrategywithcache-affine,fill-first, andround-robinoptions. The default preserves the existing HRW selection. This draft is stacked on #5053.Part of code-yeongyu/oh-my-openagent#10146.
Root cause
Account selection had no explicit strategy setting: the generic credential pool and Claude subscription lane always used their existing affinity ordering. Users could not choose stored-order filling or distribute new sessions through a round-robin cursor while retaining each session's prompt-cache locality.
Fix
credentials.accountStrategypolicy inmodels.jsonand Claude'santhropicSubscriptionProvider.accountStrategyin settings, naming the field on invalid values.affinity: falsebehavior when no explicit strategy is configured.Evidence
The same focused regression file was run through the coding-agent Vitest package runner, without live model requests.
61ae034991d3035168842eeb8863680d5f28d0e6: 20 failed, 23 passed, 43 total; exit 1. Failures show missing settings support and incorrect fill-first/round-robin selection.oxfmt --check, changed-TypeScriptoxlint, andgit diff --checkpassed.Evidence is held locally:
Summary by cubic
Adds per-provider
accountStrategyso new sessions can pick accounts by stored order or round-robin instead of the defaultcache-affine(HRW) ordering.New Features
credentials.accountStrategyinmodels.jsonfor generic providers, oranthropicSubscriptionProvider.accountStrategyinsettings.jsonfor Claude; project settings override global settings.fill-firstfollows stored account order;round-robinassigns consecutive new sessions to consecutive accounts via a process-local cursor and remembers each session's chosen account.affinity: falsebehavior; invalid values produce a config error naming the field.Written for commit 42c1ae0. Summary will update on new commits.
Still open: typed blocked-account surface
This PR does not deliver the typed RPC/desktop surface that says why an account is blocked, until when, and what to do. That is the one open item for account visibility. It is tracked on #4092 (blocked on #4992 and #4674) and starts as soon as those two merge.