Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Validation
Notes
note: greptile review for oc-chatgpt-multi-auth. cite files like
lib/foo.ts:123. confirm regression tests + windows concurrency/token redaction coverage.Greptile Summary
this PR extracts the low-risk supervisor plumbing from #207 into a focused, reviewable unit. it adds the
codexCliSessionSupervisorboolean config flag (schema + default + accessor) and wires abort-signal support intofetchCodexQuotaSnapshot, covering all yield points in the model-probe loop.lib/schemas.ts/lib/config.ts:codexCliSessionSupervisorflag added consistently with all other boolean config accessors — synchronous, no filesystem I/O, no token exposurelib/quota-probe.ts:signal?: AbortSignaladded toProbeCodexQuotaOptions; abort checks at loop entry, post-getCodexInstructions, post-unsupported-model, and in the catch block; outer signal is correctly forwarded to the innerAbortControllerand listener is removed infinallytest/plugin-config.test.ts: 5 existing snapshots updated + focused 4-casedescribeblock for env/config precedencetest/quota-probe.test.ts: 4 new tests covering pre-aborted, mid-fetch abort, post-instructions abort, and abort-before-fallback scenariosthrowIfQuotaProbeAbortedcalls at lines 347 and 349 have no yield point between them — the inner call is redundant; also the catch block re-throws whatever error was caught (not guaranteed to be anAbortError) when the outer signal is aborted, which may mislead callers that detect abort byerror.nameConfidence Score: 5/5
Important Files Changed
signal?: AbortSignaltoProbeCodexQuotaOptionsand wires it throughfetchCodexQuotaSnapshotwith abort checks before each yield point; abort signal is correctly forwarded to the innerAbortControllerand cleaned up in finally; minor: redundant double-check at loop entry and possible non-AbortError surfacing when abort races a network failurecodexCliSessionSupervisor: falsedefault andgetCodexCliSessionSupervisoraccessor usingresolveBooleanSetting— consistent with all other boolean config accessors; synchronous, no filesystem I/O, no token exposurecodexCliSessionSupervisor: z.boolean().optional()toPluginConfigSchema— minimal, correct, consistent with adjacent boolean flagsdescribeblock covering default, config-only, env-disable, and env-enable paths forgetCodexCliSessionSupervisor; all env keys properly cleaned up viadelete process.envSequence Diagram
sequenceDiagram participant Supervisor participant fetchCodexQuotaSnapshot participant AbortController (inner) participant fetch Supervisor->>fetchCodexQuotaSnapshot: call(options.signal) loop for each model fetchCodexQuotaSnapshot->>fetchCodexQuotaSnapshot: throwIfAborted(signal) [loop guard] fetchCodexQuotaSnapshot->>fetchCodexQuotaSnapshot: await getCodexInstructions(model) fetchCodexQuotaSnapshot->>fetchCodexQuotaSnapshot: throwIfAborted(signal) [post-instructions] fetchCodexQuotaSnapshot->>AbortController (inner): new AbortController() alt signal already aborted fetchCodexQuotaSnapshot->>AbortController (inner): controller.abort(signal.reason) else Supervisor-->>fetchCodexQuotaSnapshot: signal "abort" event → onAbort() fetchCodexQuotaSnapshot->>AbortController (inner): controller.abort(signal.reason) end fetchCodexQuotaSnapshot->>fetch: fetch(url, {signal: controller.signal}) alt fetch succeeds fetch-->>fetchCodexQuotaSnapshot: Response fetchCodexQuotaSnapshot->>fetchCodexQuotaSnapshot: clearTimeout + removeEventListener fetchCodexQuotaSnapshot-->>Supervisor: CodexQuotaSnapshot else fetch aborted / timeout fetch-->>fetchCodexQuotaSnapshot: AbortError fetchCodexQuotaSnapshot->>fetchCodexQuotaSnapshot: catch: if signal.aborted → rethrow fetchCodexQuotaSnapshot-->>Supervisor: AbortError end endPrompt To Fix All With AI
Last reviewed commit: "feat: add session su..."