Skip to content

Handle non-resumable pending user input#2766

Open
mjc wants to merge 1 commit into
pingdotgg:mainfrom
mjc:pending-user-input-fix
Open

Handle non-resumable pending user input#2766
mjc wants to merge 1 commit into
pingdotgg:mainfrom
mjc:pending-user-input-fix

Conversation

@mjc
Copy link
Copy Markdown

@mjc mjc commented May 19, 2026

What Changed

  • Treat Codex's non-resumable pending user-input callback error as a stale pending request.
  • Clear stale pending user-input state in both server projections and web session derivation.
  • Cover the Codex error wording in server and web tests.

Why

Submitting answers to a stale/non-resumable pending user-input request could look like it did something, then leave the user stuck on the same prompt. This keeps the fix small and consistent with the existing string-matching recovery shape already used for stale pending provider callbacks.

This is also one instance of a broader state-modeling problem. I want to make these invalid states unrepresentable; there are about a dozen bugs like this or more that I run into regularly, and they make the app pretty unusable. I would be down to do the sweeping refactor required to address state drift between the UI and the server, and between different parts of the UI itself, instead of relying on projected stale state recovery.

Testing:

  • bun fmt
  • bun lint (existing warnings only)
  • bun typecheck
  • bun run test

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes (no UI changes)
  • I included a video for animation/interaction changes (no animation/interaction changes)

Note

Low Risk
Low risk: changes are limited to broadened string-matching for provider error details and additional tests, with no schema or control-flow refactors.

Overview
Handles non-resumable user-input callbacks as stale. The server ProviderCommandReactor and projection pipeline now recognize additional "unknown pending user input"/"unknown pending codex user input" error phrasings and convert them into stale failures that clear pending user-input state.

Aligns UI derivation and tests. Web session logic is updated to treat the same error details as stale, and new/updated tests cover the Codex wording plus a new projection test asserting pending_user_input_count is cleared after the failure.

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

Note

Handle non-resumable pending user input by recognizing additional provider error messages

Extends error detection in three places to treat 'unknown pending user input request' and 'unknown pending codex user input request' (case-insensitive) as signals that a pending user-input request cannot be resumed:

Macroscope summarized e724823.

Copilot AI review requested due to automatic review settings May 19, 2026 23:49
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

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

Run ID: 87ba20f6-28ef-4bf8-ab16-393c37639005

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels May 19, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR expands “stale/unknown pending user input request” detection to handle additional error message variants (including the Codex-specific wording) and updates tests accordingly.

Changes:

  • Added new substring matches for “unknown pending user input request” (no hyphen) and “unknown pending codex user input request”.
  • Updated web and server logic to recognize the new error detail formats.
  • Updated tests to use the new Codex error detail string.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
apps/web/src/session-logic.ts Extends stale/unknown pending request detection to include Codex wording variants.
apps/web/src/session-logic.test.ts Updates test fixture detail string to match new provider error format.
apps/server/src/orchestration/Layers/ProviderCommandReactor.ts Broadens matching for unknown pending user-input errors (including Codex variant) with lowercasing.
apps/server/src/orchestration/Layers/ProviderCommandReactor.test.ts Updates test to assert behavior using the new Codex error detail string.
apps/server/src/orchestration/Layers/ProjectionPipeline.ts Extends pending user input count logic to include new “unknown pending …” variants.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/server/src/orchestration/Layers/ProjectionPipeline.ts
Comment on lines +145 to +157
const detail = error.detail.toLowerCase();
return (
detail.includes("unknown pending user-input request") ||
detail.includes("unknown pending user input request") ||
detail.includes("unknown pending codex user input request")
);
}
return Cause.pretty(cause).toLowerCase().includes("unknown pending user-input request");
const message = Cause.pretty(cause).toLowerCase();
return (
message.includes("unknown pending user-input request") ||
message.includes("unknown pending user input request") ||
message.includes("unknown pending codex user input request")
);
Copy link
Copy Markdown
Author

@mjc mjc May 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a helper feels like the wrong thing, these really should not be string matching so much... there's not enough use of types in this app and state drifts constantly as a result

@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented May 19, 2026

Approvability

Verdict: Approved

Straightforward bug fix that adds additional error message patterns to detect non-resumable user input requests. The changes are mechanical string pattern additions with no new capabilities or behavioral changes beyond improved error detection. The review comment about code duplication is a style concern, not a correctness issue.

You can customize Macroscope's approvability policy. Learn more.

@mjc mjc force-pushed the pending-user-input-fix branch from 84c9167 to e724823 Compare May 20, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 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.

2 participants