fix(server): recover stale Codex approval callbacks - #5195
fix(server): recover stale Codex approval callbacks#5195luckyPipewrench wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
ApprovabilityVerdict: Approved 80d72a4 This is a straightforward bug fix that extends error detection to recognize an additional error message pattern for Codex approval callbacks. The change is self-contained: it adds a new string pattern to an existing error detection function and normalizes case sensitivity. No new behavior paths are introduced. You can customize Macroscope's approvability policy. Learn more. |
What Changed
Normalize Codex's provider-specific missing approval callback error into T3 Code's existing provider-neutral stale approval failure at the provider command reactor boundary.
This keeps web, desktop, mobile, projection counts, and thread settling on the existing shared recovery path without teaching clients about a Codex-specific error string.
Why
Approval cards are durable, but provider callbacks are in memory. After a Codex session restarts or is recovered, responding to an old card can return
Unknown pending Codex approval request. That error was not recognized by the approval classifier, so T3 persisted the raw failure and left the impossible approval pending.The normalized failure clears the stale request without emitting
approval.resolvedor executing the rejected command.Checklist
Note
Low Risk
Small change to error-string classification in the approval response path; behavior aligns with existing stale-approval recovery and does not alter auth or data handling.
Overview
Extends the provider command reactor’s stale approval classifier so Codex’s in-memory callback errors are treated like existing “unknown pending approval” failures.
isUnknownPendingApprovalRequestErrornow matchesunknown pending codex approval request(alongside the generic approval/permission strings), andCause.prettymatching is case-insensitive so mixed-case provider details still classify correctly. When matched, failures still surface as the sharedStale pending approval request: …activity—not a fakeapproval.resolvedand not executing the command.The reactor test was updated to simulate Codex’s
item/requestApproval/decisionerror shape and asserts thatprovider.approval.respond.failedcarries the normalized stale detail and that noapproval.resolvedactivity is emitted.Reviewed by Cursor Bugbot for commit 80d72a4. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix
isUnknownPendingApprovalRequestErrorto recover stale Codex approval callbacksExtends the detection logic in
isUnknownPendingApprovalRequestErrorin ProviderCommandReactor.ts to match the phrase'unknown pending codex approval request'in addition to the existing phrase. The pretty-printed cause message is now lowercased before matching, making all checks case-insensitive.Macroscope summarized 80d72a4.