Claude Code agent smoke test #186
Notifications
Due Date
No due date set.
Blocks
#188 Package skeletons and hybrid gitops check
Mortis/Holocron
Reference: Mortis/Holocron#186
Reference in new issue
Block a user
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:
smoke-lead(model pinned to A, strict tools list includingagent, body: delegate tosmoke-child),smoke-child(model pinned to B, writes a marker file), and a copy ofsmoke-leadwhose tools list leaves outagent;apm install --target claudeinto a scratch consumer, then run headless withclaude --agent smoke-lead -p ….Judge each behaviour from evidence, never from what the model says about itself:
--agentdelegates to a subagent: the marker file exists.modelis honoured: the session's logs or usage output name the model.agentin its tools to delegate: the negative copy fails.The resolution records pass or fail per behaviour, with the evidence.
Resolution
All three behaviours pass on Claude Code 2.1.326 with apm 0.28.0. The evidence comes from
--output-format stream-json --verboselogs 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.--agentdelegates to a subagentMARKER_LEADexists on disk. The lead made anAgenttool_use withsubagent_type: smoke-child, the child'sWriteappears underparent_tool_use_id, and the lead's init tools are[Task, Read], so it could not have written the marker itself.modelis usedmodel: haiku) carryclaude-haiku-5-5. Messages from the subagent (model: sonnet) carryclaude-sonnet-5-5. ThemodelUsagekeys are exactly those two IDs.[Read]. The run made no tool_use, set noparent_tool_use_id, wrote noMARKER_NEG, and itsmodelUsagelists only haiku.Facts for the build tickets
apm install --target claudeonly renamesX.agent.mdto.claude/agents/X.md. Thetoolsandmodelfrontmatter are not touched, so whatever we write is exactly what Claude Code reads.AgentandTaskwork intools. The init event lists the tool asTask, while the tool_use is namedAgent. WriteAgent, which is the current name.resultevent. 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 twosystem/initevents and tworesultevents with the same session_id. This is input for Run mode: anything parsing headless output must wait for the finalresult, not the first.< /dev/nullto avoid a 3 s "no stdin data" wait.type: hybridwith only.apm/agents/gave no warning.