fix(desktop): replay pending prompts on tab switch to preserve plan m…#4286
Merged
SivanCola merged 2 commits intoJun 13, 2026
Merged
Conversation
…odal (esengine#4275) When switching back to a plan-mode tab, the 3-button modal (revise/execute/exit) was lost because ReplayPendingPrompts() was only called on initial mount, not on tab change. The backend still held the pending exit_plan_mode approval event but the frontend never re-emitted it. Root cause: ReplayPendingPrompts() was only in the mount-effect, never triggered when activeTabId changes. Fix: add a useEffect that calls app.ReplayPendingPrompts() on every activeTabId change, so switching back to a plan-mode session rebuilds the approval modal.
Collaborator
|
Added a supplemental regression commit What changed:
Verified:
Note: |
SivanCola
approved these changes
Jun 13, 2026
SivanCola
left a comment
Collaborator
There was a problem hiding this comment.
Approved. This fixes the reported tab-switch plan approval loss by replaying pending approval/ask prompts whenever the active tab changes, while preserving the existing mount/reconnect replay path.
Why this solves #4275:
- The backend already retains the pending
exit_plan_modeapproval while the run loop waits. ReplayPendingPrompts()re-emits that pending prompt, and desktop tab events carrytabId, so the frontend reducer can rebuild the modal for the correct tab.- The supplemental regression now covers the active-tab replay trigger and the failure-swallowing behavior expected from the effect.
Verified:
pnpm --dir desktop/frontend testpassedgo test ./internal/control -run TestReplayPendingPrompts -count=1passedgit diff --check HEAD~1..HEADpassed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…odal (#4275)
When switching back to a plan-mode tab, the 3-button modal (revise/execute/exit) was lost because ReplayPendingPrompts() was only called on initial mount, not on tab change. The backend still held the pending exit_plan_mode approval event but the frontend never re-emitted it.
Root cause: ReplayPendingPrompts() was only in the mount-effect, never triggered when activeTabId changes.
Fix: add a useEffect that calls app.ReplayPendingPrompts() on every activeTabId change, so switching back to a plan-mode session rebuilds the approval modal.