Pipeline agents cannot submit handoffs in a worktree-isolated session: the guard refuses the subagent-stop heredoc #819
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#819
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Agent charters tell each pipeline agent to submit its handoff with a heredoc piped into
os-sdlc-subagent-stop. When the orchestrating session is isolated in a worktree (EnterWorktree, or a session started inside one), the Claude Code worktree guard refuses that command. Agents with a Write tool can write the payload to a file and redirect it. Agents without a Write tool (test-reviewer, behavior-verifier, suite-check, contract-auditor) cannot submit at all. The dispatch stays open and returns nonext_step.Observed
Implementation 71 (#814), 2026-09-28. Dispatch 707 (change-auditor) was refused 3 times, the last with a minimal heredoc and an empty items list:
Dispatch 710 (test-reviewer) has no Write tool, so it could not create the payload file. The orchestrator submitted 7 of 10 handoffs by hand. It copied the YAML from the agent's final output into a JSON file and ran
os-sdlc-subagent-stop --target os-sdlc < file. A plain redirect passes the guard. Session b505a812 (#808, implementation 67) hit the same guard and used a scratchpadsubmit-handoff.rb.Reproduce
Origin
VERDICT: CREATE
REASON: This is an observed failure that a second session (b505a812, #808) also hit. The guard is an upstream tool, not something this session caused. Read-only agents cannot submit handoffs at all, so dispatches stay open. The charters' heredoc submission contract is the DESIGN cause, and the chain does not end in IMPROVISATION.
Resolution
Done: os-sdlc-subagent-stop accepts the handoff as --json '' (one simple command, no heredoc, no pipe, no file). All ten charters use it; apostrophes are written as ' in JSON. Stdin stays for the SubagentStop hook. Root cause: the Claude Code worktree guard refuses any non-simple Bash command, and #706 had only moved the heredoc from a file write into the stop command.
Evidence: main
3764b363+c5328d62(mergeded3b8295). cli_subagent_stop_test 22 runs 0 failures incl. --json success and invalid-JSON cases; probes exit 3 missing_dispatch_id as designed; no charter contains <<'JSON'. Full suite 1328 runs, 0 failures.Follow-ups: none
Needs review: Live check: in a session that entered a worktree with EnterWorktree, run one pipeline dispatch and confirm the harness guard accepts os-sdlc-subagent-stop --json ''. This session was not worktree-isolated, so the guard never ran.
Live run evidence, 2026-09-29: /os-sdlc:implement 827 (implementation 78) ran from a worktree-isolated session (EnterWorktree on .claude/worktrees/ticket-827). All 8 dispatches (775-782) submitted their own handoffs and returned next_step, including the read-only agents test-reviewer (778), behavior-verifier (780), suite-check (781) and contract-auditor (782). The orchestrator submitted zero handoffs by hand. The worktree guard refused no subagent-stop call. Result: implementation_complete in 6 min 8 s, 0 retries.
Resolution
Done: The needs-review live check passed. In a worktree-isolated session, every pipeline agent submitted its handoff with os-sdlc-subagent-stop --json and the worktree guard accepted it.
Evidence: Live run 2026-09-29 (comment 13:05): /os-sdlc:implement 827, implementation 78, EnterWorktree on .claude/worktrees/ticket-827. Dispatches 775-782 all self-submitted and returned next_step, including read-only test-reviewer 778, behavior-verifier 780, suite-check 781, contract-auditor 782. Zero guard refusals, zero hand submissions; implementation_complete, 0 retries. Code: main
3764b363+c5328d62(mergeded3b8295).Follow-ups: none