{"record":{"id":"2516d484d30ade35","repo":"Hmbown/CodeWhale","slug":"fleet-authority-mismatch-at-the-spawn-boundary-the-receipt","errorCode":null,"errorMessage":"Fleet authority mismatch at the spawn boundary: the receipt names {key}=`{expected_value}` but the child would be constructed with `{actual}`. Refusing the spawn — a Fleet ceiling that does not reach the runtime is not a ceiling.","messagePattern":"Fleet authority mismatch at the spawn boundary: the receipt names (.+?)=`(.+?)` but the child would be constructed with `(.+?)`\\. Refusing the spawn — a Fleet ceiling that does not reach the runtime is not a ceiling\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/tools/subagent/mod.rs","lineNumber":11049,"sourceCode":"    let actual_write = input\n        .get(\"write_authority\")\n        .and_then(Value::as_str)\n        .unwrap_or(\"read_only\");\n    let actual_depth = input\n        .get(\"max_depth\")\n        .and_then(Value::as_u64)\n        .map(|depth| depth.to_string())\n        .unwrap_or_default();\n\n    for (key, actual) in [\n        (\"write\", actual_write.to_string()),\n        (\"depth\", actual_depth),\n        (\"allow\", actual_allow),\n        (\"deny\", listed(\"disallowed_tools\")),\n    ] {\n        let expected_value = fields.get(key).copied().unwrap_or_default();\n        if expected_value != actual {\n            return Err(anyhow!(\n                \"Fleet authority mismatch at the spawn boundary: the receipt names {key}=`{expected_value}` \\\n                 but the child would be constructed with `{actual}`. Refusing the spawn — a Fleet \\\n                 ceiling that does not reach the runtime is not a ceiling.\"\n            ));\n        }\n    }\n    Ok(())\n}\n\n// === Sub-agent Execution ===\n\n/// Build the system prompt for a sub-agent.\n///\n/// Starts with the per-type prompt (`FleetRole::system_prompt`) and\n/// appends a one-line role overlay when `assignment.role` is set. The\n/// full role library — TOML overlays from `~/.deepseek/roles/`, the\n/// `/roles` slash command, model overrides per role — lands in 0.6.7.\n/// For 0.6.6 we just don't drop the role on the floor: the model sees","sourceCodeStart":11031,"sourceCodeEnd":11067,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/tools/subagent/mod.rs#L11031-L11067","documentation":"After parsing the Fleet authority fingerprint, the spawn boundary re-derives the actual ceilings (depth, allowed/denied tools) the child would be constructed with and compares each against the receipt. Any mismatch aborts the spawn, because a Fleet ceiling recorded in the receipt that does not reach the runtime is not an enforced ceiling.","triggerScenarios":"Spawning a sub-agent where the receipt's depth, allow-list, or deny-list differs from the runtime envelope actually constructed — e.g. the receipt says depth=2 but the child would be built with depth=3, or the receipt's disallowed_tools disagrees with the runtime's deny set.","commonSituations":"A parent edited the child's tool list after the receipt was issued, an inherited budget/depth was changed by config while the receipt pinned the old values, or two components disagree about which settings define the child envelope.","solutions":["Re-issue the Fleet authority receipt after changing depth or tool policy so it matches the runtime envelope","Align the child's constructed depth/allow/deny values with the receipt instead of changing them ad hoc","Check which config layer is overriding the inherited values and remove the conflicting override","Log both the receipt fields and actual fields to identify exactly which key mismatched (the error names it)"],"exampleFix":"// before: envelope drifts from receipt\nlet child = build_child(depth = 3, allow = &[\"read\"]);\n// after: derive envelope from the same authority values\nlet child = build_child(depth = receipt_depth, allow = &receipt_allow);","handlingStrategy":"validation","validationCode":"let receipt_depth: u32 = fields[\"depth\"].parse()?;\nif constructed_depth != receipt_depth {\n    return Err(\"child envelope must be built from receipt values\".into());\n}","typeGuard":null,"tryCatchPattern":"match spawn_child(&receipt, &input) {\n    Err(e) if e.to_string().contains(\"Fleet authority mismatch\") => {\n        // named key tells you which field drifted; rebuild from receipt\n        let child = build_child_from_receipt(&receipt)?;\n        child.run(&input)\n    }\n    other => other,\n}","preventionTips":["Construct the child envelope exclusively from receipt fields — never independent config","Re-issue the receipt whenever depth or tool policy changes","Log receipt vs actual fields for every spawn to catch drift early"],"tags":["subagent","fleet","authority","mismatch"],"backgroundTag":"invalid-state-transition","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T16:17:23.217Z"}