Repository navigation
Stop restore retries from typing into an already-running agent - #12654
benstpierre wants to merge 4 commits into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe restore retry now checks for a live agent before replaying retained startup input. Live-agent evidence clears the retry and marks the restore as running. New tests cover resend ownership and related panel and restore states. ChangesRestore retry ownership
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Possibly related PRs
Merge Risk: ⚪ Minimal · up to The restore retry change preserves matching live-agent ownership, including Dock binding-only restores, so no merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 24 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (24 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 4 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
Thank you for this, @benstpierre! You were on this first: a week later #13891 removed the whole startup-input resend path, so restore retries can't type into a running agent anymore and this patch has nothing left to guard. Really appreciate you chasing it :) |
Fixes #12653
A restored agent can start while Bash 3.2 leaves cmux's cached shell state at
promptIdle. The delayed retry then types a second restore selector into the running agent. Check existing matching-agent process evidence at the retry boundary, retire the retained input when the agent is alive, and mark the restore running. Both Workspace and Dock pass this evidence; an idle shell without live-agent proof keeps its one-shot retry for lost typeahead.Validation: the regression is committed before the fix. Three of six test functions fail with 13 assertions before; all six functions / nine expanded cases pass after. Both full tagged app builds succeed. With an identical synthetic restore fixture, the native before app delivers the duplicate command and the native after app delivers none; the app confirms matching-process liveness in both. Xcode project normalization, test wiring, package lockfile policy, and whitespace checks pass.
The native fixture and screenshots are review evidence, separate from the production change. Native runtime verification covers Workspace delivery; Dock shares the gate and compiles. Missing process evidence and full persisted-session/Codex UI restoration remain outside the proven scope. No new user-facing strings or localization changes.
Related earlier symptom report: #9831. That report predates this retry; do not mark it fixed solely on this evidence.
Reproducible evidence
Before — the compiled app sends the duplicate selector into the synthetic agent:
After — the compiled app retires the selector and the agent receives no duplicate input:
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes #12653. Stops restore retries from typing a second restore selector into an already-running agent when Bash 3.2 leaves the cached shell state at
promptIdle.RestoredStartupInputOwnershipTestscovering live, transferred, abandoned, and retry-retention cases.Written for commit a78f53e. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
Tests