From a48d78f8eb5b064c70c309834df2d7035753646b Mon Sep 17 00:00:00 2001 From: Omar Sobh Date: Thu, 6 Aug 2026 19:26:59 -0700 Subject: [PATCH] test(missions): a composed node is offered the same help as a solo one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every composed run so far reports `subagents: 0`, and the honest question is whether that is the tasks being small or the capability being absent. It is the former, and this is what says so: a composed node's task text is built by `microvm_turn_executor` and then wrapped by the SAME `vm_prompt` inside `run_inside`, so one prompt builder serves both paths and both carry the `Agent` tool offer and the `verifier` / `explorer` roles. Asserted rather than left to code reading, because if someone gave composed nodes their own prompt without the offer, the difference would show up only as a count nobody was watching — and "the graph fanned out but no node did" is indistinguishable from "no node needed to". The roles are read from `agent_definitions()` rather than spelled out, so adding a role without mentioning it in the prompt fails here instead of shipping a role the lead is never told about. 535 tests pass, clippy clean. Co-Authored-By: Claude Opus 5 --- crates/cm-api/src/microvm_executor.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/crates/cm-api/src/microvm_executor.rs b/crates/cm-api/src/microvm_executor.rs index 297f79a..b60376e 100644 --- a/crates/cm-api/src/microvm_executor.rs +++ b/crates/cm-api/src/microvm_executor.rs @@ -949,6 +949,24 @@ mod tests { assert!(!BLOCKS_PROBE.contains(GUEST_REPO), "{BLOCKS_PROBE}"); } + /// EVERY VM turn is offered delegation, composed nodes included. + /// + /// A composed node's task text is built by `microvm_turn_executor` and then + /// wrapped by this same `vm_prompt` inside `run_inside`, so one prompt + /// builder serves both paths. Composed runs report `subagents: 0` so far, + /// and this is what says that is the TASKS being small rather than the + /// capability being absent — if someone gave composed nodes their own + /// prompt without the offer, the difference would otherwise show up only as + /// a count nobody was watching. + #[test] + fn every_vm_turn_is_offered_the_same_help() { + let p = vm_prompt("do the thing"); + assert!(p.contains("Agent tool"), "{p}"); + for role in agent_definitions().as_object().unwrap().keys() { + assert!(p.contains(role.as_str()), "the prompt must name the `{role}` role: {p}"); + } + } + /// The agent must not be told to push: delivery is host-side, and the guest /// deliberately holds no forge credentials. #[test]