Skip to content

fix(server): recover stale Codex approval callbacks - #5195

Open
luckyPipewrench wants to merge 1 commit into
pingdotgg:mainfrom
luckyPipewrench:fix/stale-provider-approval-recovery
Open

fix(server): recover stale Codex approval callbacks#5195
luckyPipewrench wants to merge 1 commit into
pingdotgg:mainfrom
luckyPipewrench:fix/stale-provider-approval-recovery

Conversation

@luckyPipewrench

@luckyPipewrench luckyPipewrench commented Aug 1, 2026

Copy link
Copy Markdown

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.resolved or executing the rejected command.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • No UI layout changes require screenshots
  • No animation or motion changes require video

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.

isUnknownPendingApprovalRequestError now matches unknown pending codex approval request (alongside the generic approval/permission strings), and Cause.pretty matching is case-insensitive so mixed-case provider details still classify correctly. When matched, failures still surface as the shared Stale pending approval request: … activity—not a fake approval.resolved and not executing the command.

The reactor test was updated to simulate Codex’s item/requestApproval/decision error shape and asserts that provider.approval.respond.failed carries the normalized stale detail and that no approval.resolved activity is emitted.

Reviewed by Cursor Bugbot for commit 80d72a4. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix isUnknownPendingApprovalRequestError to recover stale Codex approval callbacks

Extends the detection logic in isUnknownPendingApprovalRequestError in 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.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b1e6ac62-b104-4d1b-a23b-867deb848a08

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Aug 1, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant