fix(agent): mention stopping worktree workers only when stop is available
- commit
- 0dca9c40e2c7be05bae4a1e6ae15a11a12154cb3
- author
- brice · · 2026-10-18 18:04 UTC
- parent
- dd4a900
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +2 -3
M packages/agent/settings_store.go +1 -2
| @@ -305,7 +305,6 @@ Plan parallelism before spawning: | |||
| 305 | 305 | ||
| 306 | 306 | Clean up as soon as a worker's result is integrated: | |
| 307 | 307 | - Remove merged sub-worktrees and their branches with the worktree tool's cleanup action, setting into to the feature branch and delete_branch to true. | |
| 308 | - | - Stop idle isolation:"worktree" workers once their patch is applied so their temporary worktree is removed. | |
| 309 | 308 | - Before your final answer, check with the worktree tool's list action that no worktree you created is left behind unless the user should keep it. | |
| 310 | 309 | ||
| 311 | 310 | When you delegate: | |
| @@ -375,7 +374,7 @@ func subagentsSystemAddendumFor(base, unavailable string, strict bool, actions S | |||
| 375 | 374 | lifecycle = append(lifecycle, "use interrupt to cancel only a worker's running turn while keeping its context, for example before asking it to wrap up") | |
| 376 | 375 | } | |
| 377 | 376 | if actions.Stop { | |
| 378 | - | lifecycle = append(lifecycle, "use stop to request termination of a stuck worker") | |
| 377 | + | lifecycle = append(lifecycle, "use stop to request termination of a stuck worker, and to remove an idle isolation:\"worktree\" worker's temporary worktree once its patch is applied") | |
| 379 | 378 | } | |
| 380 | 379 | if len(lifecycle) != 0 { | |
| 381 | 380 | addendum += "\n\nSubagent manager lifecycle actions available: " + strings.Join(lifecycle, "; ") + "." | |
| @@ -305,7 +305,6 @@ Plan parallelism before spawning: | |||||
| 305 | 305 | ||||
| 306 | Clean up as soon as a worker's result is integrated: | 306 | Clean up as soon as a worker's result is integrated: | ||
| 307 | - Remove merged sub-worktrees and their branches with the worktree tool's cleanup action, setting into to the feature branch and delete_branch to true. | 307 | - Remove merged sub-worktrees and their branches with the worktree tool's cleanup action, setting into to the feature branch and delete_branch to true. | ||
| 308 | - | - Stop idle isolation:"worktree" workers once their patch is applied so their temporary worktree is removed. | |||
| 309 | - Before your final answer, check with the worktree tool's list action that no worktree you created is left behind unless the user should keep it. | 308 | - Before your final answer, check with the worktree tool's list action that no worktree you created is left behind unless the user should keep it. | ||
| 310 | 309 | ||||
| 311 | When you delegate: | 310 | When you delegate: | ||
| @@ -375,7 +374,7 @@ func subagentsSystemAddendumFor(base, unavailable string, strict bool, actions S | |||||
| 375 | lifecycle = append(lifecycle, "use interrupt to cancel only a worker's running turn while keeping its context, for example before asking it to wrap up") | 374 | lifecycle = append(lifecycle, "use interrupt to cancel only a worker's running turn while keeping its context, for example before asking it to wrap up") | ||
| 376 | } | 375 | } | ||
| 377 | if actions.Stop { | 376 | if actions.Stop { | ||
| 378 | - | lifecycle = append(lifecycle, "use stop to request termination of a stuck worker") | 377 | + | lifecycle = append(lifecycle, "use stop to request termination of a stuck worker, and to remove an idle isolation:\"worktree\" worker's temporary worktree once its patch is applied") |
| 379 | } | 378 | } | ||
| 380 | if len(lifecycle) != 0 { | 379 | if len(lifecycle) != 0 { | ||
| 381 | addendum += "\n\nSubagent manager lifecycle actions available: " + strings.Join(lifecycle, "; ") + "." | 380 | addendum += "\n\nSubagent manager lifecycle actions available: " + strings.Join(lifecycle, "; ") + "." | ||
M packages/agent/settings_store_test.go +1 -1
| @@ -8,7 +8,7 @@ import ( | |||
| 8 | 8 | func TestSubagentsSystemAddendaListOnlyEnabledLifecycleTools(t *testing.T) { | |
| 9 | 9 | // Substrings that identify the lifecycle action guidance. | |
| 10 | 10 | const ( | |
| 11 | - | stopAction = "use stop to request termination of a stuck worker" | |
| 11 | + | stopAction = "use stop to request termination of a stuck worker, and to remove an idle isolation:\"worktree\" worker's temporary worktree" | |
| 12 | 12 | resumeAction = "use resume with an agent id and follow-up prompt" | |
| 13 | 13 | interruptAction = "use interrupt to cancel only a worker's running turn" | |
| 14 | 14 | noSpawnNotice = "Spawning new workers is unavailable" | |
| @@ -8,7 +8,7 @@ import ( | |||||
| 8 | func TestSubagentsSystemAddendaListOnlyEnabledLifecycleTools(t *testing.T) { | 8 | func TestSubagentsSystemAddendaListOnlyEnabledLifecycleTools(t *testing.T) { | ||
| 9 | // Substrings that identify the lifecycle action guidance. | 9 | // Substrings that identify the lifecycle action guidance. | ||
| 10 | const ( | 10 | const ( | ||
| 11 | - | stopAction = "use stop to request termination of a stuck worker" | 11 | + | stopAction = "use stop to request termination of a stuck worker, and to remove an idle isolation:\"worktree\" worker's temporary worktree" |
| 12 | resumeAction = "use resume with an agent id and follow-up prompt" | 12 | resumeAction = "use resume with an agent id and follow-up prompt" | ||
| 13 | interruptAction = "use interrupt to cancel only a worker's running turn" | 13 | interruptAction = "use interrupt to cancel only a worker's running turn" | ||
| 14 | noSpawnNotice = "Spawning new workers is unavailable" | 14 | noSpawnNotice = "Spawning new workers is unavailable" | ||