Repository navigation
Conversation
…ike crawl crawlBranch followed subplanners whose status is running or handed-off; collectRunningAgentsInTree (kill-tree) followed only running ones, so a verifier or worker still running under a handed-off subplanner was listed by crawl but reported as "nothing to kill". Both walkers now use one predicate, descendsIntoSubplanner, so they cannot drift again. Test builds a two-branch repo with a handed-off subplanner and a running child and asserts crawl and kill-tree both see it. Fixes cursor#641.
Author
|
Hey all, for the record: #645 (Ehsan-hash) was opened about an hour before this one and fixes the same |
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
Fixes #641.
crawlBranch(used bycrawl) descends into a subplanner branch when its status isrunningorhanded-off;collectRunningAgentsInTree(used bykill-treeviafilterVictimsToSubtree) descended only onrunning. A subplanner whose own run has ended ishanded-offin the parent'sstate.json, but thestate.jsonon its branch can still holdrunningrows withagentId/runId(a verifier or respawn it started before returning, workers in flight).crawllisted those agents;kill-treeprintednothing to killand left them running, while the doc comment oncollectRunningAgentsInTreeand thekill-treehelp text both say the two walk the tree the same way.Both walkers now share one predicate,
descendsIntoSubplanner(t)(runningorhanded-offsubplanner), so they cannot drift apart again. No other behaviour changes:kill-treestill only collects tasks that arerunningwith both ids; it just also looks under handed-off subplanners to find them.If the orchestrate owners prefer the opposite contract (skip handed-off branches on purpose), the same helper is the one place to say so, and the help text and
crawloutput should then say it too.Verification
__tests__/kill-tree-handed-off.test.tsbuilds a temp repo withorigin/<branch>refs for a root planner (subplanner rowhanded-off) and the subplanner's own branch (worker rowrunning), and assertscrawlBranchprints the worker andcollectRunningAgentsInTreereturns it. Fails onmain(0 collected), passes with the fix.bun testinorchestrate/skills/orchestrate/scripts: 211 tests, 0 fail;bun run typecheckclean.