Conversation
Use the stored pin when no request slot is supplied, preserving explicit API-key and slot precedence. This keeps compaction on the account selected for ordinary requests and scopes OAuth refresh to that account. Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Drive the real source CLI with isolated synthetic OAuth accounts and a localhost quota fixture. Assert compaction account selection, committed summary replay, and complete sandbox cleanup without real provider calls. Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Preserve upstream auth changes and resolve change-tracker and changelog conflicts. Keep the pinned-account fix under Unreleased. Revalidated the complete AI suite, static checks, build, and isolated CLI compaction. Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
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
Direct authentication lookup now honors the stored pinned account when a caller does not explicitly select a credential slot. This fixes compaction using an exhausted default account while ordinary conversation successfully uses another pinned account.
The reported environment was OMO
5.0.0-0.beta.52, Senpi2026.9.10, andopenai-codex / gpt-6-astra. The fix belongs in Senpi's shared auth resolver rather than a patch to an installed JavaScript bundle.Confirmed defect and account-selection policy
The reproduced defect is that compaction bypasses the ordinary request account-selection path and reads the flat default credential even while a usable account is pinned. Selecting the default account is valid when the normal selection or failover policy chooses it; the account being named
defaultis not itself an error.The intended consistency is for compaction using the same provider to respect the session's account-selection and failover policy. That does not require forcing every request onto an unavailable pinned account.
What this patch proves, and what remains to review
login-6and an exhausted default account, ordinary requests succeed while unpatched compaction selects default and fails. The same real-CLI scenario succeeds after this patch. Explicit request-key and slot overrides retain precedence.packages/coding-agent/src/core/credential-pool/failover.ts, using health information overlaid inrotation-stream.ts. The shared selector also explicitly tests fallback from a blocked pin inpackages/ai/test/credential-pool-select.test.ts. The new direct-lookup fallback does not consult that health state. A real compaction scenario with an unavailable pin has not been verified.The original healthy-pin defect is therefore independently demonstrated, but the passing regression suite should not be read as proof of full account-selection policy parity. Before merge, review the usable, blocked, and missing-pin cases together, keeping explicit per-request overrides authoritative.
Changes
Verification
Failing-first auth regression
bun run --cwd packages/ai test -- test/auth-pinned-resolve.test.tsBefore the fix: 5 failed, 6 passed. Implicit OAuth/API-key pins, missing-pin isolation, and pinned OAuth refresh failed. Explicit key/slot overrides and unpinned defaults passed.
After the fix: 11 passed, 0 failed.
Real CLI compaction
The driver launches the repository CLI through RPC with a synthetic session and isolated OAuth storage. A localhost provider rejects the default account with HTTP 402 and accepts
login-6. It does not replace the resolver, pool selection, compaction machinery, or RPC handlers.The final fixture was run against the old behavior with
--expect redbefore restoring the fix. RED passed 14 bug-signature assertions; GREEN passed 16 success assertions. Every run verified that the CLI process group, localhost server, and sandbox were removed and real auth was unchanged. No real provider calls or user conversations were used.Other checks
After merging current
maininb4d314b3f, the complete AI suite passed 2,716 tests with 0 failures (884 pre-existing opt-in skips), and static checks, the full build, the local changelog gate, and all 16 real-CLI compaction assertions passed again. Follow-up receipts are underlocal-ignore/qa-evidence/20260910-pinned-compaction/merge-followup/. The counts below describe the original pre-merge verification.tsc --noEmit, and browser smoke. Biome ran read-only instead of using the root command's auto-write flag.bun run build: passed all workspace phases.git diff --check: passed.Sanitized local receipts are retained under
local-ignore/qa-evidence/20260910-pinned-compaction/:red.txt,green.txt,cli-red.json,cli-green.json,auth-scoped-green.txt,ai-suite-green.txt,check-build-green.txt,final-static.txt,cli-smoke.txt, andREADME.md. Evidence is intentionally not committed under the repository's QA policy; the driver and assertions are included for reproduction.Scope and remaining coverage
The production change is the stored-pin fallback plus an annotation using the existing pooled credential type. It applies to shared text/image auth lookup, not just the compaction caller.
The CLI scenario ran on macOS with synthetic OAuth and an OpenAI-compatible localhost endpoint. Credentialed Codex calls and the complete unrelated coding-agent test suite were not run. The LSP tool could not initialize with the native TypeScript installation; the actual TypeScript compiler and build passed.
Summary by cubic
Fixes direct auth resolution so compaction uses the stored pinned account instead of the flat default credential. Previously an exhausted default account blocked compaction while ordinary conversation used another pinned account; now the stored pin is honored whenever no credential slot is explicitly requested.
Bug Fixes
Written for commit b4d314b. Summary will update on new commits.