Fix desktop long-history lag and cancellation state / 修复桌面端长历史卡顿与取消状态#5512
Merged
SivanCola merged 2 commits intoJun 28, 2026
Merged
Conversation
fdc204a to
5f79395
Compare
This was referenced Jun 28, 2026
Closed
Closed
5f79395 to
f331c5b
Compare
f331c5b to
c9a358c
Compare
This was referenced Jun 28, 2026
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
turn_done, moveBalanceForTabout of the blocking hydrate path, and coalesce transcript resize repinning into animation frames.RunShellcancellation so Stop can reconcile the foreground turn cleanly.Fixes #5306
Fixes #5200
Fixes #5499
Fixes #4986
Refs #5355
Refs #5495
Refs #5210
Consolidation notes
Kept/adapted:
sessionPathidentity guard, then extends the same hydration flow to use paged history instead of all-history reloads.Reviewed but not adopted:
Transcript; this PR focuses on the long-history hydrate payload and reducer path.Repository Contributor Credits
Cache impact
Cache-impact: none for provider prompt caching. This changes desktop/Wails history hydration, frontend state handling, controller shell cancellation, shell process-tree cleanup, idle-goal cancellation, post-cancel transcript cleanup, and session sidecar recovery metadata; it does not change system prompts, provider request serialization, tool schemas, memory prefixes, or compaction behavior.
Cache-guard: N/A for provider cache; focused desktop/frontend and Go tests are listed below.
System-prompt-review: N/A.
Verification
git diff --check origin/main-v2...HEADgo test ./...go test ./internal/controlgo test ./internal/agentgo test ./internal/tool/builtingo test ./internal/procgo test ./internal/agent -run 'TestSessionInFlightTurnMetaRoundTrip|TestRunCancelledMidStreamLeavesResumableSession|TestCancelDuring(StuckProviderStreamReturnsPromptly|ToolExecutionBreaksOutPromptly|BatchStopsRemainingTools)|TestCancelBeforeParallelBatchSkipsTheWholeRemainingBatch|TestCancelInsideLargeParallelBatchStopsSchedulingNewTools'go test ./internal/control -run 'TestResumeClearsStale(Visible|Synthetic)InFlightTurn|TestTurnOrchestratorCancelPreservesVisibleUserPrompt|TestTurnOrchestratorCancelFlushesCleanTranscriptToDisk|TestCancelStopsIdleGoalWithIncompleteTodos|TestRunShell_CancelStopsCommand'go test ./internal/tool/builtin -run 'TestBash(CancelReturnsPromptly|ForegroundTimeoutConfig|ExplicitZeroTimeoutDoesNotCapForeground)|TestWorkspacePassesBashTimeout|TestShouldReapAfterRunHonorsExplicitPreserveOnlyOnCompletion|TestReapTreeKillsBackgroundProcess|TestBackgroundKill'GOOS=windows GOARCH=amd64 go test -c ./internal/tool/builtinGOOS=windows GOARCH=amd64 go test -c ./internal/procgo test . -run 'TestHistory(Page|Checkpoint|Preview|Resume)'from the desktop modulepnpm --dir desktop/frontend typecheckpnpm --dir desktop/frontend check:csspnpm --dir desktop/frontend exec tsx src/__tests__/composer-goal-toggle.test.tsxpnpm --dir desktop/frontend exec tsx src/__tests__/use-controller-meta.test.tspnpm --dir desktop/frontend exec tsx src/__tests__/tab-switch-hydration.test.tsxpnpm --dir desktop/frontend exec tsx src/__tests__/new-session-load-race.test.tsxpnpm --dir desktop/frontend exec tsx src/__tests__/use-controller-cancel-reconcile.test.tsxpnpm --dir desktop/frontend exec tsx src/__tests__/resize-drag.test.ts