os-sdlc: PostToolUse fires at launch for async Agent dispatches — pipeline must dispatch synchronously or handle early events #402
Labels
No labels
P0
P1
P2
P3
bug
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
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#402
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?
Context
Live capture 2026-08-15 confirmed the PostToolUse hook fires at agent LAUNCH for async Agent dispatches (tool_response.status: "async_launched", duration_ms ~3), not at completion. The Runner only sees completed work at hook time if pipeline agents are dispatched synchronously (foreground). Docs updated in docs/os-sdlc-rebuild/dispatch-hook.md (commit
eacd3e5). Follow-up: decide whether pipeline agents must always be dispatched synchronously, or whether the runner needs to handle early/async events.VERDICT: CREATE — live-verified correctness gap in the Runner's completion signal; passes all gauntlet tests.
Decision 2026-08-15 (code-probe evidence brief): enforce sync-only dispatch loudly. The hook never reads tool_response (plugins/os-sdlc/hooks/post_tool_use.rb — dispatchable_event reads only tool_name and subagent_type), so an async_launched event currently advances the pipeline as if the agent finished. Full async support (deferring to a completion event) is contingent on an unverified assumption that a completion-time PostToolUse event exists at all for async dispatches — out of scope here.
Tasks
Acceptance criteria
Out of scope
Handling async dispatches to completion (Option A) — blocked on live-verifying whether a completion-time PostToolUse event exists for async dispatches; if wanted, that is a separate ticket.
Blocking edges
None.
Work starting via os-sdlc pipeline on branch worktree-issue-402
Resolution
Done: Hook guard implemented: PostToolUse events with tool_response.status async_launched never advance the pipeline and emit a loud additionalContext error naming the sync-only constraint (run_in_background: false). Test coverage added at the hook process boundary; sync path unchanged. ADR-0121 recorded; dispatch-hook.md and implement SKILL.md updated to name the enforcement.
Evidence: Commit
1d8a520on branch worktree-issue-402: plugins/os-sdlc/hooks/post_tool_use.rb guard + plugins/os-sdlc/tests/runner/post_tool_use_async_dispatch_test.rb; suite green (920 runs, 0 failures); changed files rubocop-clean; reviewer verdict APPROVE (.sdlc/tickets/402/verdict.md); docs/adr/0121.Follow-ups: none — full async support (completion-event handling) already scoped out to a separate ticket by the ticket itself