fix(desktop): session lease, terminal restore, goal todos, git confirm / 会话锁·终端·待办·Git 确认 - #7833
Open
SivanCola wants to merge 1 commit into
Open
fix(desktop): session lease, terminal restore, goal todos, git confirm / 会话锁·终端·待办·Git 确认#7833SivanCola wants to merge 1 commit into
SivanCola wants to merge 1 commit into
Conversation
… git confirm Problem - Multi-tab project switching sporadically surfaces "session is already open" (esengine#7732, esengine#7592). - Switching chat tabs made open terminals appear closed (esengine#7744). - Empty creation hero hid Plan/Goal/Standard before the first message (esengine#7731). - Stale open todos re-triggered "delivery checks incomplete" on later turns in balanced mode (esengine#7694, esengine#7634). - Exact-looking destructive git (checkout/reset/push) auto-ran under Auto without a human card (esengine#7784). Root cause - Lease contention budget was only two short retries against stacked probes. - Terminal list required the active tab, racing optimistic frontend switches. - Hero mode intentionally hid mode chrome. - Final readiness fell back to canonical todos outside delivery. - Bash approval treated simple git checkout as reusable under Mode=Allow. Fix - Expand session-lease contention retries (8 x 40ms). - Allow terminal list/snapshot for any open tab; keep mutations active-only. - Keep task mode, runtime profile, and approval chrome visible in hero mode. - Restrict canonical-todo final-readiness fallback to delivery profile. - Classify high-risk git bash as require-human under Auto. Verification - go test ./internal/agent/ ./internal/permission/ - go test . -run 'TerminalWorkspaceLists|TerminalTarget|EnsureTabSessionLease' (desktop)
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
Completes the remaining P3–P5 items from the 48h bug triage plan.
checkout/reset --hard/push/…) requires human even in AutoDetails
Lease
Transient
CleanupStaleRunningprobes plus multi-project tab switches could exhaust a 2-attempt window and leave a sticky “already open” startup error.Terminal
Frontend switches optimistically and re-syncs before
SetActiveTabreturns. RequiringtabID == activeTabIDfor list made the previous tab look empty.Todos
Balanced mode still blocks this turn’s incomplete
todo_writeafter a write, but no longer re-blocks every later turn via the delivery-only canonical fallback (which the UI labels as “交付检查尚未完成”).Git
git checkoutis exact-looking shell, so Auto previously allowed it. It now maps tobashApprovalRequireHuman(same class as dynamic bash), so Auto prompts; YOLO still bypasses by design.Test plan
go test ./internal/agent/ ./internal/permission/TerminalWorkspaceListsInactiveTabSessions+ lease/target testsgit checkoutprompts; YOLO may still auto-runRelated
中文摘要
修复多会话误锁、切换后终端“消失”、空会话无法选模式、均衡模式待办反复交付检查,以及 Auto 下
git checkout不经确认的问题。