Claude Code agent smoke test #186

Closed
opened 2026-11-22 16:08:40 +00:00 by Claude · 1 comment
Owner

Part of #166

Question

Does Claude Code behave as the delivery team's design assumes when its agents are deployed by apm? Run a throwaway smoke test in a scratch directory and commit nothing:

  • a local apm package with smoke-lead (model pinned to A, strict tools list including agent, body: delegate to smoke-child), smoke-child (model pinned to B, writes a marker file), and a copy of smoke-lead whose tools list leaves out agent;
  • apm install --target claude into a scratch consumer, then run headless with claude --agent smoke-lead -p ….

Judge each behaviour from evidence, never from what the model says about itself:

  1. A main-session --agent delegates to a subagent: the marker file exists.
  2. Each agent's pinned model is honoured: the session's logs or usage output name the model.
  3. A strict-tools-list agent needs agent in its tools to delegate: the negative copy fails.

The resolution records pass or fail per behaviour, with the evidence.

Part of #166 ## Question Does Claude Code behave as the delivery team's design assumes when its agents are deployed by apm? Run a throwaway smoke test in a scratch directory and commit nothing: - a local apm package with `smoke-lead` (model pinned to A, strict tools list including `agent`, body: delegate to `smoke-child`), `smoke-child` (model pinned to B, writes a marker file), and a copy of `smoke-lead` whose tools list leaves out `agent`; - `apm install --target claude` into a scratch consumer, then run headless with `claude --agent smoke-lead -p …`. Judge each behaviour from evidence, never from what the model says about itself: 1. A main-session `--agent` delegates to a subagent: the marker file exists. 2. Each agent's pinned `model` is honoured: the session's logs or usage output name the model. 3. A strict-tools-list agent needs `agent` in its tools to delegate: the negative copy fails. The resolution records pass or fail per behaviour, with the evidence.
Claude added this to the Map: Infra and agent-team packages milestone 2026-11-22 16:08:40 +00:00
Claude added the Wayfinder/Task label 2026-11-22 16:08:40 +00:00
Claude added a new dependency 2026-11-22 16:09:25 +00:00
Defame1297 was assigned by Claude 2026-11-22 19:25:28 +00:00
Author
Owner

Resolution

All three behaviours pass on Claude Code 2.1.326 with apm 0.28.0. The evidence comes from --output-format stream-json --verbose logs and from files on disk, never from what the model said about itself. The test was a throwaway run in a scratch directory and nothing was committed.

# Behaviour Result Evidence
1 A main-session --agent delegates to a subagent PASS MARKER_LEAD exists on disk. The lead made an Agent tool_use with subagent_type: smoke-child, the child's Write appears under parent_tool_use_id, and the lead's init tools are [Task, Read], so it could not have written the marker itself.
2 Each agent's pinned model is used PASS Messages from the main session (model: haiku) carry claude-haiku-5-5. Messages from the subagent (model: sonnet) carry claude-sonnet-5-5. The modelUsage keys are exactly those two IDs.
3 A strict tools list needs the delegation tool PASS The negative copy's init tools are [Read]. The run made no tool_use, set no parent_tool_use_id, wrote no MARKER_NEG, and its modelUsage lists only haiku.

Facts for the build tickets

  • apm deploys agents unchanged. apm install --target claude only renames X.agent.md to .claude/agents/X.md. The tools and model frontmatter are not touched, so whatever we write is exactly what Claude Code reads.
  • Delegation tool spelling. Both Agent and Task work in tools. The init event lists the tool as Task, while the tool_use is named Agent. Write Agent, which is the current name.
  • Headless runs can emit more than one result event. When the subagent ran in the background, the lead ended its turn first, and the task notification then started a second turn. The output had two system/init events and two result events with the same session_id. This is input for Run mode: anything parsing headless output must wait for the final result, not the first.
  • Prompt precedence. The child followed the lead's delegation prompt rather than its own body (it wrote the text the lead asked for). Stage leads' delegation prompts therefore steer specialists, and specialist bodies should state their hard constraints as rules, not defaults.
  • Headless stdin. Run with < /dev/null to avoid a 3 s "no stdin data" wait.
  • Package type. type: hybrid with only .apm/agents/ gave no warning.
## Resolution All three behaviours **pass** on Claude Code 2.1.326 with apm 0.28.0. The evidence comes from `--output-format stream-json --verbose` logs and from files on disk, never from what the model said about itself. The test was a throwaway run in a scratch directory and nothing was committed. | # | Behaviour | Result | Evidence | |---|---|---|---| | 1 | A main-session `--agent` delegates to a subagent | PASS | `MARKER_LEAD` exists on disk. The lead made an `Agent` tool_use with `subagent_type: smoke-child`, the child's `Write` appears under `parent_tool_use_id`, and the lead's init tools are `[Task, Read]`, so it could not have written the marker itself. | | 2 | Each agent's pinned `model` is used | PASS | Messages from the main session (`model: haiku`) carry `claude-haiku-5-5`. Messages from the subagent (`model: sonnet`) carry `claude-sonnet-5-5`. The `modelUsage` keys are exactly those two IDs. | | 3 | A strict tools list needs the delegation tool | PASS | The negative copy's init tools are `[Read]`. The run made no tool_use, set no `parent_tool_use_id`, wrote no `MARKER_NEG`, and its `modelUsage` lists only haiku. | ### Facts for the build tickets - **apm deploys agents unchanged.** `apm install --target claude` only renames `X.agent.md` to `.claude/agents/X.md`. The `tools` and `model` frontmatter are not touched, so whatever we write is exactly what Claude Code reads. - **Delegation tool spelling.** Both `Agent` and `Task` work in `tools`. The init event lists the tool as `Task`, while the tool_use is named `Agent`. Write `Agent`, which is the current name. - **Headless runs can emit more than one `result` event.** When the subagent ran in the background, the lead ended its turn first, and the task notification then started a second turn. The output had two `system/init` events and two `result` events with the same session_id. This is input for Run mode: anything parsing headless output must wait for the final `result`, not the first. - **Prompt precedence.** The child followed the lead's delegation prompt rather than its own body (it wrote the text the lead asked for). Stage leads' delegation prompts therefore steer specialists, and specialist bodies should state their hard constraints as rules, not defaults. - **Headless stdin.** Run with `< /dev/null` to avoid a 3 s "no stdin data" wait. - **Package type.** `type: hybrid` with only `.apm/agents/` gave no warning.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: Mortis/Holocron#186