Repository navigation
task-recreate-worker --agent X in a worktree that predates X's loadout launches an agent with no radio hooks, then reports Recovered: preflight the worktree's hook carrier, verify the register, warn at switch time - #309
Merged
Conversation
…t launches an agent with no radio hooks, then reports Recovered: preflight the worktree's hook carrier, verify the register, warn at switch time A worktree holds what was committed when it was forked, so one cut before `task-config add assistant` has no hooks for the newer assistant, and an agent started there never registers (#304). - lib/hook-carrier.sh: does a checkout (or a ref) carry an assistant's radio hooks: `.claude/settings.json` / `.kiro/agents/worker.json` (or kiro's global agent) with a `radio register` hook; plus the stale-worktree lister and the merge remedy. - task-recreate-worker refuses a hookless worktree before touching the sidecar, naming `git -C <worktree> merge <base>`; after the launch it waits up to TASK_RECREATE_WORKER_REGISTER_WAIT (30s) for a fresh register by the expected AGENT with a matching TAB_ID, and prints Recovered (and the queued mail line) only then; otherwise it warns with the reason and likely causes. - task-work --from refuses a ref lacking the hooks HEAD carries. - task-config add / use warn, listing live worktrees without the new assistant's hooks, each with its merge. Tests for every acceptance case, each mutation-checked; stubs can now run the tab payload and play a SessionStart register. Docs: README, the 8 workflow docs, CHANGELOG. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t launches an agent with no radio hooks, then reports Recovered: silence SC2016 on the literal hook commands in seed_hook_carriers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
Spec compliance (#304)All three Fix items and the acceptance list are delivered.
Code-review findingsI read the diff and checked the pieces below against the repo. I found no blockers.
Optional nit, not blocking:
Verdictclean-with-nits. I found nothing blocking, and the PM can decide on the one optional nit above. |
…t launches an agent with no radio hooks, then reports Recovered: match radio register as words anywhere in the hook command `_aw_carries_radio_register` grepped for a leading-quote `"radio register`, so a hook command with a prefix (an env assignment, an absolute path to radio, `command radio …`) was refused as carrying no hooks. It now matches the two words anywhere, bounded so `myradio register` still does not count. A new bats case covers both prefixed forms and the lookalike; it is red against the old pattern and against one without the leading boundary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
task-recreate-workernow refuses to launch an agent into a worktree that has no radio hooks for it, and names the merge that fixes it. It also prints "Recovered" only after it has seen the new session actually register with radio.task-work --fromandtask-config add/useget the matching check and warning, so a worktree forked before a loadout was committed can no longer give you an agent that is silently unreachable.Closes #304
What changed
lib/hook-carrier.sh(new). It checks whether a checkout or a ref carries an assistant's radio hooks: aradio registerhook in.claude/settings.json(claude), or in.kiro/agents/worker.jsonor the global agent kiro-cli falls back to (kiro). It also lists stale worker worktrees and prints the remedy:git -C <worktree> merge <base>, or "commit it on the base first" when the base does not carry the hooks either.task-recreate-worker:--no-launchskips the check.TASK_RECREATE_WORKER_REGISTER_WAIT(30s) for the session file to show a register that is newer than the launch, by the expectedAGENT, with a non-emptyTAB_IDmatching the captured tab. Only then does it printRecovered, the agent and tab id, and the queued-mail line. Otherwise it prints a warning with the specific reason and the likely causes: a trust prompt or upgrade dialog waiting, the picker under--resume, or an agent that exited. It exits 0 in that case.--resumesession-id lines now print before the check, so they appear either way.task-work --from <ref>refuses a ref that lacks the hooksHEADhas. A hooklessHEADis not refused, since a merge would not help, and neither is--no-launch.task-config add assistant/usewarn with a list of live worker worktrees (reviewers skipped) that lack the new assistant's hooks, each with its merge command. Afteraddthe warning also says the new loadout is not committed yet. This is a warning, never a refusal.--no-launch, polling vs. the wait bound, the exact stale-session-file state from task-recreate-worker --agent X in a worktree that predates X's loadout launches an agent with no radio hooks, then reports Recovered #304, a register by the wrong agent, and one with an emptyTAB_ID. Each of the 20 mutations tried turned at least one test red. To support this, the zellij stub can run the tab payload, the claude stub can play aSessionStartregister (optionally delayed), andsetup_stubssets the wait to 0.task-recreate-worker,task-config,--from), all 8 workflow docs (edited identically, so the byte-identity test still passes), and the CHANGELOG.Decisions worth a look
--merge-baseoption. The issue left this to the builder. The refusal prints the exact command, and running a merge inside someone's worktree is the user's call.Rsurfaces only failures, so it shows "recreated" without the warning.R. task-monitor'sRruns this command synchronously, so a register that never lands now freezes the board for up to 30s. A normal launch returns as soon as the register lands. MakingRasync is a monitor change, out of this PR's scope.Verification
./run_tests.sh: 1584 tests, all passtools/check-drift.sh: cleanshellcheck -xon the changed shell files: cleanHOMEandTASK_FORCE_HOMEand stubbed zellij, claude and kiro; no real agent was launched.🤖 Generated with Claude Code