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
clean plumbing PR that wires the
codexCliSessionSupervisorboolean flag through schema, config default, env override accessor, and snapshot tests, then addsAbortSignalsupport tofetchCodexQuotaSnapshotwith proper listener cleanup and abort re-checks around every async suspension point.lib/schemas.ts+lib/config.ts:codexCliSessionSupervisoradded as an optional zod boolean, defaults tofalse, overridable viaCODEX_AUTH_CLI_SESSION_SUPERVISOR. accessor is synchronous, side-effect free, no token or filesystem exposure — consistent with existingresolveBooleanSettingpattern.lib/quota-probe.ts:signal?: AbortSignaladded toProbeCodexQuotaOptions. the innerAbortControllercorrectly forwards the caller signal via an{ once: true }listener, handles the pre-aborted edge case, and cleans up infinally. abort guards are placed at every async boundary (before instructions load, after instructions load, after unsupported-model response). no filesystem access or token leak introduced.test/plugin-config.test.ts: all four supervisor override paths covered; env var lifecycle correctly cleaned up per test. existing config snapshot assertions updated.test/quota-probe.test.ts: four focused abort scenarios cover pre-aborted signal, mid-fetch abort, post-instructions abort, and abort during unsupported fallback — good vitest coverage for the new behavior.throwIfQuotaProbeAbortedat line 349 (insidetry) is a no-op duplicate of line 347 (outsidetry) — js is single-threaded so the signal cannot flip between two synchronous lines. no runtime impact; see inline comment.Confidence Score: 5/5
finally+{ once: true }prevents leaks, pre-abort detection guards every async suspension point, and the catch correctly re-surfaces AbortErrors. the only finding is a redundant synchronous guard (line 349) that is dead code but harmless. test coverage is solid across all four new abort scenarios.Important Files Changed
codexCliSessionSupervisorboolean flag toDEFAULT_PLUGIN_CONFIGand a cleangetCodexCliSessionSupervisoraccessor that delegates to existingresolveBooleanSettingwithCODEX_AUTH_CLI_SESSION_SUPERVISORenv override. no filesystem i/o, no token exposure, side-effect free.signal?: AbortSignaltoProbeCodexQuotaOptionsand wires abort-awareness throughoutfetchCodexQuotaSnapshot. abort propagation and listener cleanup are correct. one redundant synchronous guard at line 349 (inside try) duplicates the check at line 347 (outside try) — dead code, no runtime impact.codexCliSessionSupervisor: z.boolean().optional()toPluginConfigSchema— minimal, consistent with the surrounding schema entries.codexCliSessionSupervisor: falseto all existing config-snapshot assertions and adds a focuseddescribeblock with four cases covering default, config override, env disable, and env enable. full env var lifecycle (delete, set, delete) is properly managed to avoid state leakage.Sequence Diagram
sequenceDiagram participant Caller participant fetchCodexQuotaSnapshot participant AbortController participant fetch as fetch(Codex API) Caller->>fetchCodexQuotaSnapshot: call({ signal }) loop for each model fetchCodexQuotaSnapshot->>fetchCodexQuotaSnapshot: throwIfAborted(signal) [line 347 – outside try] fetchCodexQuotaSnapshot->>fetchCodexQuotaSnapshot: await getCodexInstructions(model) fetchCodexQuotaSnapshot->>fetchCodexQuotaSnapshot: throwIfAborted(signal) [post-instructions] fetchCodexQuotaSnapshot->>AbortController: new AbortController() alt signal already aborted fetchCodexQuotaSnapshot->>AbortController: controller.abort(signal.reason) else Caller-->>fetchCodexQuotaSnapshot: signal "abort" event → onAbort fires fetchCodexQuotaSnapshot->>AbortController: controller.abort(signal.reason) end fetchCodexQuotaSnapshot->>fetch: fetch(..., { signal: controller.signal }) fetch-->>fetchCodexQuotaSnapshot: response / AbortError fetchCodexQuotaSnapshot->>fetchCodexQuotaSnapshot: clearTimeout + removeEventListener alt signal aborted in catch fetchCodexQuotaSnapshot-->>Caller: throw AbortError end end alt signal aborted after loop fetchCodexQuotaSnapshot-->>Caller: throw AbortError end fetchCodexQuotaSnapshot-->>Caller: CodexQuotaSnapshot | lastErrorPrompt To Fix All With AI
Reviews (2): Last reviewed commit: "feat: add session supervisor config plum..." | Re-trigger Greptile