fix(desktop): persist mode and toolApprovalMode without round-trip loss, report PendingPrompt in Meta#5482
Closed
erphenheimer wants to merge 1 commit into
Closed
Conversation
a0b0ff2 to
2372891
Compare
…ss, report PendingPrompt in Meta (esengine#5480 esengine#5481) Bug 1: Session switching causes mode (ask/auto/yolo) to flicker - persistedTabMode always persists the mode value (no longer returns '' for 'normal', which lost information on round-trip) - persistedToolApprovalMode always persists (no longer returns '' for 'ask') - Loading code now reconciles desync in BOTH directions: * Mode implies yolo but toolApprovalMode is ask -> upgrade to yolo * Mode is normal but toolApprovalMode is yolo/auto -> update mode Bug 2: Switching to a running session loses ask/plan state in other sessions - Added PendingPrompt bool field to Meta struct so the frontend receives pending-prompt status when loading a tab's metadata - Frontend can now properly restore pending ask dialogs on tab switch Tests: 7 new test functions covering all mode round-trips, ALL mode+toolApprovalMode combinations, older-format backward compatibility, and PendingPrompt reporting. Cache-impact: none (desktop module, not in cache-sensitive paths) Cache-guard: N/A (desktop/ module, no system prompt or provider changes) System-prompt-review: N/A
2372891 to
19dcc9c
Compare
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.
Summary
Fix two related desktop bugs where session switching corrupts or loses the mode (ask/auto/yolo/plan) state for non-focused tabs. Both bugs stem from the same root cause: the mode and toolApprovalMode fields in WorkspaceTab were persisted using an encoding that dropped default values ("" for "normal" and "ask"), causing round-trip information loss on every save+reload.
Changes
Bug fix: mode/toolApprovalMode round-trip loss (desktop/tabs.go)
Bug fix: missing PendingPrompt in Meta (desktop/app.go)
Robustness: bidirectional reconciliation in loading code (desktop/app.go)
Verification
Related Issues
Cache-impact: none (desktop module only)
Cache-guard: N/A
System-prompt-review: N/A