subagents: test that children get project context; consider a lighter explore prompt #156

Closed
opened 2026-10-15 20:18:05 +00:00 by hermes · 0 comments
Collaborator

Correction to the earlier review

I first suspected subagents lose AGENTS.md/memory/skills. That is wrong: crates/hx-cli/src/main.rs (~l.796) builds system: format!("{base}{tail}") for both roles, so they get the full prompt_tail.

Remaining points

  1. No test asserts it. Add a test in crates/hx-core/src/subagent.rs (or the CLI) that a child request's system contains the AGENTS.md text, so a refactor cannot silently drop it.
  2. Cost question (unmeasured): the cheap explore child also gets the whole skills index, # Skills block, and memory index, which it rarely needs. Measure the size of tail on a real setup. If it is large (several k tokens), give explore only cwd + AGENTS.md.
  3. GENERAL_PROMPT is one sentence and does not tell the child to verify its edits; add the same verify line as the main prompt once that issue lands.

Verify

Test for (1); token count of the explore request's system prompt before/after for (2).

## Correction to the earlier review I first suspected subagents lose `AGENTS.md`/memory/skills. That is wrong: `crates/hx-cli/src/main.rs` (~l.796) builds `system: format!("{base}{tail}")` for both roles, so they get the full `prompt_tail`. ## Remaining points 1. No test asserts it. Add a test in `crates/hx-core/src/subagent.rs` (or the CLI) that a child request's `system` contains the `AGENTS.md` text, so a refactor cannot silently drop it. 2. Cost question (unmeasured): the cheap `explore` child also gets the whole skills index, `# Skills` block, and memory index, which it rarely needs. Measure the size of `tail` on a real setup. If it is large (several k tokens), give `explore` only cwd + `AGENTS.md`. 3. `GENERAL_PROMPT` is one sentence and does not tell the child to verify its edits; add the same verify line as the main prompt once that issue lands. ## Verify Test for (1); token count of the explore request's system prompt before/after for (2).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: johannes/hx#156