Skip to content

Commit b80a5c7

Browse files
AR6420claude
andcommitted
fix: v2.1.1 β€” ghost message bug from background agent dispatch (#2)
Replace fire-and-forget dispatch model with parallel foreground dispatch. All agents are now awaited before presenting results, eliminating empty user turns caused by async agent completion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 366a820 commit b80a5c7

4 files changed

Lines changed: 65 additions & 54 deletions

File tree

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,19 @@ All notable changes to the Hydra framework will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [2.1.1] β€” Bug Fix
9+
10+
### Fixed
11+
- **Ghost message bug** (#2): Background agent dispatch (fire-and-forget) caused an
12+
empty user turn to appear in Claude Code after agent completion, triggering Claude
13+
to respond to nothing. All agents are now dispatched in parallel foreground mode β€”
14+
Opus waits for every dispatched agent before presenting results. Same speed benefit
15+
(agents still run simultaneously), no ghost messages.
16+
17+
### Changed
18+
- `SKILL.md`: "Blocking vs Non-Blocking Dispatch" section renamed to
19+
"Sequential vs Parallel Dispatch". All fire-and-forget language removed.
20+
Parallel dispatch is now the model for independent agents running simultaneously.
921

1022
## [2.1.0] - 2026-03-26
1123

@@ -127,7 +139,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
127139
- Wave execution, verification reports, handoff protocol
128140
- 4 orchestrator-level speed optimizations
129141

130-
[Unreleased]: https://github.com/AR6420/Hail_Hydra/compare/v2.1.0...HEAD
142+
[2.1.1]: https://github.com/AR6420/Hail_Hydra/compare/v2.1.0...v2.1.1
131143
[2.1.0]: https://github.com/AR6420/Hail_Hydra/compare/v2.0.3...v2.1.0
132144
[2.0.3]: https://github.com/AR6420/Hail_Hydra/compare/v2.0.0...v2.0.3
133145
[2.0.2]: https://github.com/AR6420/Hail_Hydra/compare/v2.0.1...v2.0.2

β€ŽSKILL.mdβ€Ž

Lines changed: 49 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,18 @@ User Request
9494
════════════════════════════════════════════════════════
9595
Wave N (parallel dispatch, index context injected)
9696
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
97-
β”‚ BLOCKING β”‚ NON-BLOCKING (fire & forget) β”‚
97+
β”‚ SEQUENTIAL β”‚ PARALLEL (wait for all) β”‚
9898
β–Ό β–Ό β”‚
9999
[coder] [scribe] β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
100100
β”‚
101101
β–Ό
102-
Results arrive
102+
ALL agents complete (Opus waits for every dispatched agent)
103103
β”‚
104104
β”œβ”€β”€ Raw data / clean pass? β†’ AUTO-ACCEPT β†’ (updates Session Index if scout)
105105
└── Code / analysis / user-facing docs? β†’ Orchestrator verifies
106106
β”‚
107107
β–Ό
108-
User gets result + non-blocking outputs appended when ready
108+
User gets result (single response, all agent outputs included)
109109
```
110110

111111
This mirrors speculative decoding's "draft β†’ score β†’ accept/reject" loop, but at task granularity.
@@ -226,45 +226,44 @@ If you notice the map's git_hash doesn't match HEAD and hydra-scout hasn't
226226
been dispatched yet, dispatch scout to update the map BEFORE running sentinel.
227227
A stale map is worse than no map β€” it could have incorrect dependency data.
228228

229-
## Blocking vs Non-Blocking Dispatch
229+
## Sequential vs Parallel Dispatch
230230

231-
Not all agents need to finish before the next wave starts. Classify each dispatch as
232-
blocking or non-blocking to maximize throughput.
231+
Not all agents need to be dispatched one-by-one. When agents are independent,
232+
dispatch them simultaneously and wait for ALL to complete before responding.
233233

234-
### Blocking Dispatch (wait for result before continuing)
234+
> ⚠️ **NEVER use fire-and-forget or background dispatch.** Background agent
235+
> completion triggers an empty user turn in Claude Code, causing Claude to respond
236+
> to nothing. Every dispatched agent MUST be awaited before presenting results.
237+
238+
### Sequential Dispatch (one wave at a time)
235239
Use when downstream agents DEPEND on this agent's output:
236240
- hydra-scout exploring files that hydra-coder needs to edit
237241
- hydra-analyst diagnosing a bug that hydra-coder needs to fix
238242
- hydra-coder making changes that hydra-runner needs to test
239243

240-
### Non-Blocking Dispatch (fire and forget, merge results later)
241-
Use when the output is a FINAL deliverable with no downstream dependents:
242-
- hydra-scribe writing docs (ALWAYS non-blocking unless user only asked for docs)
243-
- hydra-runner running final validation tests (the fix is already done)
244-
- hydra-scout exploring supplementary context (nice-to-have, not critical-path)
244+
### Parallel Dispatch (all at once β€” wait for ALL before responding)
245+
Use when agents are INDEPENDENT of each other:
246+
- hydra-scribe writing docs + hydra-runner running final tests
247+
- hydra-guard scanning + hydra-sentinel-scan sweeping (already enforced by Protocol 1)
248+
- hydra-scout exploring supplementary context + any other independent agent
245249

246-
### Execution Flow with Non-Blocking
250+
### Execution Flow
247251

248252
```
249-
Wave 1 (blocking): scout explores β†’ returns file paths
250-
Wave 2 (blocking): coder implements fix β†’ returns changed files
251-
Wave 3 (mixed):
252-
runner tests the fix (BLOCKING β€” need to confirm it works)
253-
scribe updates docs (NON-BLOCKING β€” fire and forget)
254-
255-
Wave 3 completes when: runner returns (don't wait for scribe)
256-
Present results to user. Scribe's docs are appended when ready.
253+
Wave 1 (sequential): scout explores β†’ returns file paths
254+
Wave 2 (sequential): coder implements fix β†’ returns changed files
255+
Wave 3 (parallel): dispatch runner AND scribe simultaneously
256+
WAIT for BOTH to complete
257+
Present single response to user (all outputs included)
257258
```
258259

259260
### Rules
260-
1. A wave completes when all BLOCKING agents in it return
261-
2. Non-blocking agents run in background β€” their output is merged into the final
262-
response or presented as a follow-up
263-
3. NEVER mark hydra-coder as non-blocking β€” code changes always need verification
264-
4. NEVER mark hydra-analyst as non-blocking β€” diagnoses feed into fixes
265-
5. hydra-scribe is non-blocking by DEFAULT unless it's the primary task
266-
6. hydra-runner is non-blocking ONLY when it's the final validation step
267-
7. If in doubt, make it blocking β€” correctness over speed
261+
1. A wave completes when ALL agents in it return β€” no exceptions
262+
2. NEVER present results while any dispatched agent is still running
263+
3. NEVER dispatch hydra-coder without awaiting the result β€” code changes always need verification
264+
4. NEVER dispatch hydra-analyst without awaiting the result β€” diagnoses feed into fixes
265+
5. hydra-scribe runs IN PARALLEL with hydra-runner by default (not after)
266+
6. If in doubt, wait for everything β€” correctness over speed
268267

269268
## Integrated Execution Model
270269

@@ -284,7 +283,7 @@ User Prompt arrives
284283
β”‚ "Find files relevant to: [prompt]" β”‚
285284
β”‚ β”‚
286285
β”œβ”€β”€ IN PARALLEL: Classify task, plan waves, β”‚
287-
β”‚ decide blocking/non-blocking per agent β”‚
286+
β”‚ decide sequential/parallel per agent β”‚
288287
β”‚ β”‚
289288
β–Ό β”‚
290289
Scout returns β”‚
@@ -299,10 +298,10 @@ Scout returns
299298
(index context injected into each agent prompt)
300299
β”‚
301300
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
302-
β”‚ BLOCKING agents ◄── Opt 3: Non-Block β”‚ NON-BLOCKING agents
303-
β”‚ (wait for result) β”‚ (fire & forget)
301+
β”‚ SEQUENTIAL agents ◄── Opt 3: Parallel β”‚ PARALLEL agents
302+
β”‚ (one wave at a time) β”‚ (dispatched together)
304303
β–Ό β–Ό
305-
Results arrive Background β€” merge when ready
304+
Results arrive All complete together
306305
β”‚ β”‚
307306
β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β” β”‚
308307
β”‚ β”‚ β”‚
@@ -332,7 +331,7 @@ Scout returns
332331
β†’ Wait β†’ Decision tree β†’ Present to user β”‚
333332
β”‚
334333
Next wave OR present result β—„β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Ίβ”˜
335-
(non-blocking outputs appended when ready)
334+
(all parallel agents completed before this point)
336335
```
337336

338337
### Optimization Interaction Rules
@@ -347,27 +346,27 @@ New prompt arrives β†’ Check Session Index coverage
347346
└── Not covered: Pre-dispatch scout β†’ Update index β†’ Wave 1 starts
348347
```
349348

350-
#### Rule 2: Non-Blocking + Auto-Accept = Zero-Overhead Path
351-
When an agent is both non-blocking AND its output qualifies for auto-accept:
352-
- Dispatch it
349+
#### Rule 2: Parallel + Auto-Accept = Zero-Overhead Path
350+
When an agent runs in parallel with others AND its output qualifies for auto-accept:
351+
- Dispatch it alongside other parallel agents
353352
- When it returns: auto-accept without orchestrator review
354-
- Append result to response
353+
- Append result to response (all parallel agents finish before the response is sent)
355354
- **Total orchestrator overhead: 0 seconds**
356355

357356
This is the highest-throughput path. Common cases:
358-
- Non-blocking hydra-runner (final validation) reporting all-pass β†’ zero overhead
359-
- Non-blocking hydra-scribe (internal docstrings) β†’ zero overhead
360-
- Non-blocking hydra-scout (supplementary context) β†’ zero overhead, index updated
357+
- Parallel hydra-runner (final validation) reporting all-pass β†’ zero overhead
358+
- Parallel hydra-scribe (internal docstrings) β†’ zero overhead
359+
- Parallel hydra-scout (supplementary context) β†’ zero overhead, index updated
361360

362361
#### Rule 3: Auto-Accepted Scout Output ALWAYS Updates Session Index
363362
Every scout output that passes auto-accept is immediately folded into the Session Index.
364363
No separate step. The act of auto-accepting IS the index update.
365364

366-
#### Rule 4: Non-Blocking Does Not Override Verification Requirements
367-
Non-blocking governs TIMING (don't wait), not VERIFICATION (do review).
365+
#### Rule 4: Parallel Dispatch Does Not Override Verification Requirements
366+
Parallel dispatch governs TIMING (run together), not VERIFICATION (do review).
368367
If scribe writes user-facing docs (README, API docs), verification is still required β€”
369-
it happens when scribe's output arrives asynchronously, not before the next wave.
370-
The next wave starts without waiting; verification happens as a follow-up step.
368+
it happens when all parallel agents complete, before the response is sent.
369+
Opus always waits for every dispatched agent before presenting results.
371370

372371
### Timing Profile: Optimized vs Baseline
373372

@@ -388,11 +387,11 @@ OPTIMIZED (all 4 optimizations active):
388387
t=3s Scout auto-accepted, index built [0s overhead]
389388
t=3s Dispatch coder (index context injected), wait [5s]
390389
t=8s Quick-scan coder (code β†’ verify) [1s]
391-
t=9s Dispatch runner (blocking) + scribe (non-blocking) [3s runner]
392-
Scribe runs in background simultaneously
393-
t=12s Runner: all-pass β†’ auto-accept [0s overhead]
394-
t=12s Present result to user
395-
Scribe arrives ~t=13s β†’ auto-accept internal docs β†’ appended
390+
t=9s Dispatch runner (parallel) + scribe (parallel) [3s β€” both run at once]
391+
Scribe and runner run simultaneously, Opus waits for both
392+
t=12s Runner: all-pass β†’ auto-accept [0s overhead]
393+
Scribe: internal docs β†’ auto-accept [0s overhead]
394+
t=12s Present result to user (single response, all outputs included)
396395
Total wall-clock: ~12 seconds (33% faster, zero quality loss)
397396
```
398397

β€Žnpm-package/package.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hail-hydra-cc",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "Multi-headed speculative execution framework for Claude Code",
55
"bin": {
66
"hail-hydra-cc": "bin/cli.js"

β€Žscripts/install.shβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ AGENTS=("hydra-scout" "hydra-runner" "hydra-scribe" "hydra-guard" "hydra-git" "h
2727

2828
COMMANDS=("update" "status" "help" "config" "guard" "quiet" "verbose")
2929
HOOKS=("hydra-check-update.js" "hydra-statusline.js" "hydra-auto-guard.js")
30-
PACKAGE_VERSION="2.0.1"
30+
PACKAGE_VERSION="2.1.1"
3131

3232
COMMANDS_SOURCE_DIR="$(dirname "$SCRIPT_DIR")/commands/hydra"
3333
HOOKS_SOURCE_DIR="$(dirname "$SCRIPT_DIR")/hooks"

0 commit comments

Comments
Β (0)