Conversation
PR 1889 CI status (post-fix)PR: #1889 My regression (fixed)
Pre-existing failures on the base (NOT from this PR)Reproduced at clean
|
Incorporate the combined implementation and regressions from senpi PR code-yeongyu#1769 as a separately reviewable prerequisite for quota-aware internal routing. Preserve newer upstream tests and document the dependency. Constraint: Reuse code-yeongyu#1769 rather than maintain a competing classifier Directive: Drop this prerequisite when PR code-yeongyu#1769 is integrated Confidence: high Scope-risk: narrow
Prefer confirmed included quota before paid credits, including cooling and leased accounts, and isolate account-switch observers from request execution. Route auxiliary model calls through session-scoped fallback while retaining explicit credential overrides and remote compaction's local fallback. Add portable regressions, safe session notices, API documentation, and fork change tracking. Preserve current-main model-switch and fallback behavior. Constraint: Unknown quota must never authorize paid usage Constraint: Explicit request keys retain upstream bypass semantics Rejected: Rotate requests carrying explicit external keys | violates caller intent Directive: Keep notification failures observational and credential-free Confidence: high Scope-risk: moderate Not-tested: Paid credits were simulated; no deliberate live credit consumption
The subscription provider id was renamed from `openai-codex` to `chatgpt-subscription` (senpi#1989) after this branch's base, so the quota admission, the account-switch notices and the internal-request OAuth strip now compare through pi-ai's `normalizeProviderId`, and the account-id header rebuild uses the renamed `extractChatGptSubscriptionAccountId` helper. Legacy ids keep resolving through the same helper, so the existing fixtures still exercise the alias path. Constraint: Upstream renamed the provider id after this branch's base Rejected: Comparing the canonical id directly | legacy ids in fixtures and stored configs would stop routing Confidence: high Scope-risk: narrow Not-tested: Windows-only CI jobs
c61256a to
ddc9666
Compare
runRotation's option Pick omitted isStreamStart, so the rotation-events threading and the non-streaming wrapper failed to typecheck on the rebased base. The Pick now names all three hooks and the non-streaming call states its event type explicitly. Constraint: Upstream's RunCredentialFailoverOptions gained isStreamStart Confidence: high Scope-risk: narrow
Summary
takes priority; unknown, cooling, and leased accounts cannot accidentally
authorize paid usage.
summaries, side queries, vision, and worker requests retain account rotation
and session-configured model fallback.
self-unsubscription cannot interrupt routing or peer observers.
callers, while retaining numeric HTTP status for active account rotation.
Prerequisite / overlap
This branch includes the implementation and regressions from #1769 as a
separate attributed prerequisite commit (
29b8846e), preserving newerupstream tests. It replaces an earlier competing classifier expression.
Please integrate #1769 first, or retain that credited prerequisite here.
It can be dropped from this branch once #1769 lands.
The feature was integrated on
cd317ee6472dde1658a75e644637691ba5d41bc1.Current-main fallback defaults, deferred model switches, context repair, and
TUI changes are preserved.
Validation
npm ci --ignore-scriptswith unchanged manifests and lockfiles.npm run check: clean formatting, dependency/import/lock checks,root/scripts typechecks, and browser smoke.
npm run build:npm: all seven workspace phases passed.generated worker RPC, title generation, and clean worker exit were exercised
with synthetic credentials and faux generation.
Tests ran with inherited
ZAI_API_KEYremoved. No personal auth/settings orgenerated distribution files are included. Paid-credit admission was simulated,
not verified by deliberately spending credits. TUI evidence covers rendering,
not a shutdown pass.
The portable regression files live under
packages/coding-agent/test/suite/{codex-quota,codex-runtime-routing,codex-auxiliary-routing,account-notices,internal-model-request}.test.*.Summary by cubic
Automatic Codex OAuth account selection now checks included quota before routing a request, so exhausted, cooling, leased, or unknown-quota accounts cannot reach paid usage. It admits only confirmed eligible accounts by default, while explicit API-key requests remain pinned and auxiliary requests use session-scoped fallback without changing the active chat model.
Routing and notices
/btw, vision, and worker requests retain account rotation and configured model fallback.normalizeProviderIdso quota admission and notices follow thechatgpt-subscriptionrename while legacyopenai-codexids keep routing.isStreamStartand event typing in sync.Written for commit d7bcb84. Summary will update on new commits.