fix(agent): fit fork_context into the existing tool-schema budget

Advertising `fork_context` on the agent tool grew every mode's tool
schema by 253 bytes and failed the runtime-contract ratchet. Instead of
raising the ceiling, drop the no-op `fork_context: {}` from the start
dependentSchema branch and tighten the `resume_from`, `fork_context` and
`wall_time_secs` descriptions (same facts, fewer words). Net: -14 bytes
per mode versus main, so the budget is tightened, and
PARENT_SURFACE_BYTE_CEILING returns to main's 88,715.

Local checks:
- check-runtime-contract-budget.py: PASS, 12 ceilings tightened (--update)
- codewhale-tui --lib tools::subagent: 738 passed, 0 failed
- codewhale-tui --lib tool_catalog/schema: 166 passed, 0 failed, 1 ignored
- test_check_runtime_contract_budget.py OK; blocking-calls budget within
- check-versions.sh --range-audit-advisory OK
- cargo fmt --all, git diff --check clean

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01R9rJEoMuUSRWznU6QjkE7h
This commit is contained in:
CodeWhale BotandClaude Opus 5.5 committed 2026-09-25 15:03:25 -07:00
1 parent 5bb33a97ab
commit 4b0f54edbb
3 files changed
+19 -22

No files matched your search

+4 -5
View File
@@ -10134,7 +10134,7 @@ impl ToolSpec for AgentTool {
},
"wall_time_secs": {
"type": "integer", "minimum": 1, "maximum": MAX_CHILD_WALL_TIME.as_secs(),
"description": "Whole-run wall time including queue, model and tools; default 1800. May raise that default, never inherited or operator limits; continuation does not restart the clock."
"description": "Whole-run wall time (queue, model, tools); default 1800, may exceed that but never inherited or operator limits. Continuation keeps the clock."
},
"deliverables": {
"type": "array", "maxItems": 16,
@@ -10159,11 +10159,11 @@ impl ToolSpec for AgentTool {
},
"fork_context": {
"type": "boolean",
"description": "For start: true = child starts from your current conversation prefix (cache-shared); false (default) = fresh context. Carries context, never permissions."
"description": "For start: true = child starts from your conversation prefix (cache-shared); default fresh. Never grants permissions."
},
"resume_from": {
"type": "string",
"description": "Settled child agent_id or session name to fork into a separate new worker. Repeating start with resume_from creates another independent worker; use action=followup to continue parked work without an accidental duplicate. The source must not be running. Its full transcript is loaded and prepended as the new child's context (fork_context=true), continuing the transcript lineage under a new role or profile (e.g. explore → implementer → verifier). Mutually exclusive with fork_context=false. Cross-workspace or missing sources are rejected with a clear error."
"description": "Settled child agent_id or session name to fork into a new independent worker; each start makes another, so use action=followup to continue parked work. Its full transcript becomes the new child's context, continuing the lineage under a new role or profile (e.g. explore → implementer → verifier). Refused with fork_context=false, or for cross-workspace or missing sources."
}
},
"dependentSchemas": {
@@ -10172,8 +10172,7 @@ impl ToolSpec for AgentTool {
{
"properties": {
"action": {"const": "start"},
"prompt": {},
"fork_context": {}
"prompt": {}
},
"required": ["prompt"]
},
+3 -5
View File
@@ -21187,11 +21187,9 @@ const READ_ONLY_CHILD_ENVELOPE_BYTE_CEILING: usize = 89_000;
// base prompt's progress-narration rule (E4, 5cf9db3d6) and the workflow
// Fleet origin list (26cfaf8de), net of the read/bash wording trims
// (105ad9d3e).
// Re-measured 2026-09-25 at 88,937B on Linux (88,924B on macOS), +222B: the
// agent schema advertises `fork_context` (it was parse-accepted but hidden).
// Re-measured 2026-09-25 at 88,968B on Linux (88,955B on macOS), +31B: the
// `wall_time_secs` description states that it may raise the 1800s default.
const PARENT_SURFACE_BYTE_CEILING: usize = 88_968;
// The agent schema's `fork_context` property (2026-09-25) fit under this
// ceiling by trimming the `resume_from` and `wall_time_secs` descriptions.
const PARENT_SURFACE_BYTE_CEILING: usize = 88_715;
#[tokio::test]
async fn read_only_child_envelope_stays_within_measured_ceiling() {
+12 -12
View File
@@ -86,9 +86,9 @@
"modes": {
"act": {
"active": {
"bytes": 33876,
"bytes": 33862,
"identity_sha256": "df6676989a677fb08fecc8bf7ae12caf4fa88e0cae3d143cea6a4da4382b746c",
"tokens_est": 8469,
"tokens_est": 8466,
"tool_names": [
"agent",
"bash",
@@ -106,9 +106,9 @@
"tools": 12
},
"full": {
"bytes": 83384,
"bytes": 83370,
"identity_sha256": "45e989bbe5ac0bb1f2d9084361c021009f30a06539f132ebd4fd2331a1bb1954",
"tokens_est": 20846,
"tokens_est": 20843,
"tool_names": [
"Git",
"Run",
@@ -169,9 +169,9 @@
},
"operate": {
"active": {
"bytes": 33876,
"bytes": 33862,
"identity_sha256": "df6676989a677fb08fecc8bf7ae12caf4fa88e0cae3d143cea6a4da4382b746c",
"tokens_est": 8469,
"tokens_est": 8466,
"tool_names": [
"agent",
"bash",
@@ -189,9 +189,9 @@
"tools": 12
},
"full": {
"bytes": 83384,
"bytes": 83370,
"identity_sha256": "45e989bbe5ac0bb1f2d9084361c021009f30a06539f132ebd4fd2331a1bb1954",
"tokens_est": 20846,
"tokens_est": 20843,
"tool_names": [
"Git",
"Run",
@@ -252,9 +252,9 @@
},
"plan": {
"active": {
"bytes": 33876,
"bytes": 33862,
"identity_sha256": "df6676989a677fb08fecc8bf7ae12caf4fa88e0cae3d143cea6a4da4382b746c",
"tokens_est": 8469,
"tokens_est": 8466,
"tool_names": [
"agent",
"bash",
@@ -272,9 +272,9 @@
"tools": 12
},
"full": {
"bytes": 53515,
"bytes": 53501,
"identity_sha256": "ac8af1f4988199825be7b00b054c258724a44074b1d4e6de6c92ade7c1cffe63",
"tokens_est": 13379,
"tokens_est": 13376,
"tool_names": [
"Git",
"Web",