Expand description
Coordinator mode gate and tool-set allow-list.
§What is coordinator mode?
When a recursive process is launched with both:
- the env var
RECURSIVE_COORDINATOR_MODE=1, AND - the cargo feature
coordinator-mode
the process runs as a coordinator — a higher-level agent that
dispatches work to teammates via the team_*, task_*, and
send_message tools, but is itself restricted to a curated
allow-list of tools. In particular, the coordinator must NOT have
direct Edit / Write / Bash access; otherwise it would
short-circuit the team and do the work itself.
§Allow-list
The set of tools available in coordinator mode is additive over the standard toolset: all non-mutating read-only tools are kept, plus a handful of “meta” tools. Tools that let the coordinator reach into the filesystem or shell are excluded.
This is intentionally conservative. A real product would also
exclude MultiEdit, NotebookEdit, etc.; we mirror that intent
below for completeness even if those tools don’t exist in the
current kernel.
Functions§
- coordinator_
deny_ list - Tools that the coordinator mode MUST NOT have access to, even if
they otherwise pass the read-only filter. This is a defense-in-depth
list — the primary filter is
coordinator_tool_set(), but if a future change accidentally broadens that list, the deny list here will still keep these out. - coordinator_
tool_ set - The set of tool names available in coordinator mode.
- filter_
registry - Prune a
ToolRegistrydown to the coordinator allow-list when the process is running in coordinator mode. No-op otherwise. This is the wiring point that the kernel calls right afterbuild_tools()— seesrc/cli/builder.rs. - is_
allowed_ in_ coordinator_ mode - Sanity check: a tool name is allowed in coordinator mode iff it is in the allow-list AND not in the deny-list. The deny-list exists to catch accidental future additions; the allow-list is the source of truth.
- is_
coordinator_ mode - Returns
trueiff this process is running in coordinator mode. - is_
coordinator_ tool - Returns
trueiftool_nameis allowed in coordinator mode.