Hmbown/CodeWhale · error · anyhow::Error

Write tool {name} did not expose a bounded repo-relative tar

Error message

Write tool {name} did not expose a bounded repo-relative target for coordination

What it means

Coordination guard for scope-aware write tools: a write/edit/patch-family tool invocation did not expose a bounded repo-relative target path that the coordination manager can claim. Writes in a shared checkout require a claimable bounded target so concurrent children cannot collide; without one the write is refused before execution.

Source

Thrown at crates/tui/src/tools/subagent/mod.rs:14829

                spec.as_ref(),
                self.execution_envelope(),
                self.bounded_readonly_bash_evidence(name, &input),
            )
            .map_err(|refusal| anyhow!(refusal))?;
        }
        let scope_aware_write = matches!(
            name,
            "write" | "edit" | "write_file" | "edit_file" | "apply_patch" | "fim_edit"
        ) || (name == "File"
            && input
                .get("action")
                .and_then(Value::as_str)
                .is_some_and(|action| matches!(action, "write" | "edit" | "patch")))
            || (name == "pandoc_convert" && input.get("output_path").is_some());
        if scope_aware_write && self.enforce_write_claim {
            let paths = mutation_paths(name, &input)?;
            if paths.is_empty() {
                return Err(anyhow!(
                    "Write tool {name} did not expose a bounded repo-relative target for coordination"
                ));
            }
            let manager = self.coordination_manager.read().await;
            manager
                .validate_write_scope(&self.owner_agent_id, &paths)
                .map_err(anyhow::Error::msg)?;
        } else if self.enforce_write_claim
            && !is_internal_coordination_state_tool(name)
            && (is_unbounded_shell_run(name, &input)
                || self.registry.get(name).is_some_and(|spec| {
                    let canonical = canonical_action_alias(name, &input);
                    let is_shell_control = matches!(
                        canonical,
                        "exec_shell_wait" | "exec_shell_interact" | "exec_shell_cancel"
                    );
                    let capabilities = spec.capabilities();
                    !is_shell_control

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Use the scope-aware file tools with an explicit repo-relative path argument
  2. Express the edit target so it resolves inside the repo (not stdout/pipe/ambiguous targets)
  3. Launch the child in a worktree so shared-checkout coordination is not required
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/tui/src/tools/subagent/mod.rs:14829 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/617249ea66360b13. Report an issue: GitHub.