-
Notifications
You must be signed in to change notification settings - Fork 269
fix(delegation): preserve live child delegation links across extension host startup (multi-window subtask return) #1495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
myk1yt
wants to merge
13
commits into
Zoo-Code-Org:main
Choose a base branch
from
myk1yt:fix/returntoparent
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,924
−39
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
edfb4ab
fix(delegation): preserve live child delegation links across extensio…
ab42767
test(task-persistence): cover mutation edge cases for live child live…
0aea3f8
test(task-persistence): kill surviving static-mutant arithmetic mutan…
5030659
chore(gitignore): ignore local worktrees (.wt-*) and scratch files
1d18172
test(task-persistence): make liveness-boundary tests filesystem-preci…
8587452
fix(delegation): guard replayDelegationRepairIntent against live cros…
30b1262
fix(delegation): run delegation reconciliation on periodic reconcile …
160e7f6
fix(delegation): use console.warn for live-child skip log
1e6c9be
test(delegation): route undefined child mtime through initialize() en…
1dfa3ae
test(lifecycle): model cross-window child liveness guard in lifecycle…
576a73e
chore(gitignore): drop local worktree and scratch ignore patterns
af3e93a
test(delegation): kill 15 surviving changed-code mutants
0c74d2d
test(delegation): replace fixed-count timer pump with condition polling
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
The delegate loop does not apply the live-elsewhere guard, so a live child can be frozen permanently.
The child loop at Line 158 skips every window-local operation on a live-elsewhere child, but this delegate loop has no such check.
delegate(child-a, child-b)is therefore enabled whilestate.liveElsewhere["child-a"]is true andchild-aisactive.Two consequences follow:
child-a.status === "delegated", soexpireLiveElsewhere(child-a)is no longer enabled (Line 235 requiresactive) and the child loop skips all operations onchild-a(Line 158). The liveness flag can never clear, andchild-acan never be interrupted, completed, or abandoned. The parent staysdelegatedto it forever. No invariant fires, so the dead state class is silently explored instead of reported.Skip the delegate transition when the acting parent is live-elsewhere, matching the child loop.
🐛 Proposed fix for the missing liveness guard
for (const parentId of taskIds) { const parent = state.tasks[parentId] if (!parent) continue + // A task owned by another window cannot start a window-local delegation. + if (state.liveElsewhere[parentId]) continue for (const childId of taskIds) { if (childId === parentId || state.tasks[childId]) continue🤖 Prompt for AI Agents