Repository navigation
fix(accounts): credit a setup-token session's rate limits to its provider account - #3957
Conversation
|
Maintainer follow-up: I am taking the conflict and CI repair for this PR. Independent triage found no security hold; the recorded Tests failure is the comment-line ceiling. I will preserve the newer parallel credential checks on main, remove the unnecessary added comments rather than raise the ceiling, verify the updated behavior, and obtain a new independent review before merging. The other open Linear-workspace PR remains separately on hold. |
…ider account, not the home login A session launched with a provider (setup-token) account runs inside the version home of a native login. The Claude status line resolved the account from that home, so it wrote the token account's headroom over the native login's usage key. On mars the poll kept recording taylor@turingsaas.com at session 100% / week 56% while the token session's status line rewrote it to 31% / 3% every refresh; each rewrite made the limited login eligible again and `agents run claude --strategy balanced` picked it, then died with "You've hit your session limit". - claude-statusline: resolve the account from AGENTS_RUN_ACCOUNT_ID. A provider account's limits land under `claude:name=<account>`, a native login keeps the home identity, an id that matches neither writes nothing. - account-pool-collect: provider candidates carry that usage key and its cached snapshot, so rotation excludes a limited token account instead of treating it as a permanently blind pick. - exec: a balanced provider pick sets the spawn account so the session gets AGENTS_RUN_ACCOUNT_ID; the pick banner names the provider account. Verified on mars with the built dist: a status line call carrying the turing-token run id wrote `claude:name=turing-token` (38% / 10%) and left `claude:org=8763a87b…` untouched; the next balanced pick listed turing-token as a verified candidate with that usage. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
69e3630 to
0ac5289
Compare
|
Independent non-author review of final head VERDICT: APPROVE. READY TO MERGE once required CI passes. No blocking security or correctness findings; requirement conformance: YES.
The independent reviewer inspected the full seven-file repaired diff, including the conflict resolution. After the history-only rebase, the reviewer independently verified that the final head and previously reviewed repair share tree Validation: canonical build passed; targeted tests reported 223 passed and one existing skip; comment ceiling and whitespace checks passed. The reviewer inspected tests without rerunning them. Required GitHub CI must pass on this final head before merge. Filtered: 2 candidates (native test state is isolated; concurrent credential checks remain intact). |
A setup-token provider session can share a managed installation with a native login. Its statusline previously wrote the provider's rate limits under the home login's identity, making an exhausted native login eligible for balanced selection again.
Resolve statusline attribution from the selected run account: provider limits use the provider's own usage key, native logins retain their home identity, and unknown account IDs write nothing. Provider candidates carry their cached usage, and balanced execution propagates the selected provider account ID. The collector preserves main's parallel credential checks.
Verification on the final file tree:
The existing skip requires a managed Claude installation absent from the isolated test home. The full monorepo suite and a production installation were not run. Required GitHub checks remain the merge gate. This PR does not publish a release.