Skip to content

Tool and role routing

Every message runs the same agent turn: the root agent, holding the general toolset plus spawn_child. The keyword classifier (src/core/agent/classifier.ts) does not decide whether an agent runs, and has not chosen the specialist since Phase 2 — a capable model reads the request better than a regex table. What it still does: scope memory retrieval by topic, and, for a small (lite-tier) model only, ride along as a hint the request itself can override.

  1. Casual patterns — greetings, thanks, yes/no. Recorded on the turn; the root answers them itself, the same way it answers everything else.
  2. Task keywords — matched against 14 categories with scoring:
    • Multi-word keywords get 1.5x weight (more specific)
    • Single-word keywords use word boundary matching
    • Score >= 1.5 → high confidence routing
    • Score 1 with > 2 words → moderate confidence
  3. Ambiguous — falls through to LLM decision

The roles the root can delegate to with spawn_child, and what each holds. The root itself runs as general, so anything in that row it does without spawning.

CategoryRoleTools AvailableTrigger Keywords (examples)
codingcodingfilesystem, shell, git, github, knowledge, task_state, repo_registry, skill-distill, mcp”implement”, “write code”, “fix bug”, “refactor”, “typescript”, “react”, “git commit”
researchresearchwebsearch, knowledge, task_state, filesystem, profiles, artifacts, artifacts_toolbox, documents, repo_registry, skill-distill, mcp”research”, “investigate”, “search the web”, “compare”, “find out”, “tell me about”
devopsdevopsshell, docker, git, filesystem, mcp”docker”, “kubernetes”, “deploy”, “CI/CD”, “nginx”, “terraform”
securitysecurityshell, filesystem, browser, browser-ext, websearch, knowledge, task_state, mcp”vulnerability”, “audit”, “OWASP”, “threat model”, “security review”
datadatadata, shell, filesystem, knowledge, task_state, artifacts, artifacts_toolbox, documents, mcp”database schema”, “SQL query”, “migration”, “ETL”, “data pipeline”, “query the database”, “analyse this CSV”
writingwritingfilesystem, browser, websearch, knowledge, task_state, messaging, documents”documentation”, “write docs”, “readme”, “technical writing”, “changelog”
designdesignbrowser, filesystem”UI design”, “UX”, “wireframe”, “mockup”, “accessibility”
financefinancebrowser, websearch, filesystem”budget”, “financial analysis”, “ROI”, “cost analysis”
communicationcommunicationgoogle-workspace, microsoft365, messaging, scheduling, profiles, notes, email-processor, voice”email”, “gmail”, “calendar”, “phone call”, “call me”, “outlook”
automationautomationshell, docker, filesystem, scheduling, mcp”schedule”, “cron”, “recurring task”, “remind me”, “automate”
architecturearchitecturefilesystem, shell, knowledge, task_state, websearch, repo_registry, mcp”architecture”, “system design”, “requirements”, “technical specification”, “design document”
qaqabrowser, browser-ext, shell, docker, filesystem, knowledge, task_state, visual, artifacts, artifacts_toolbox”run tests”, “test suite”, “validate”, “verify”, “validation”
reviewreviewfilesystem, shell, git, github, knowledge, task_state, repo_registry, visual”review the code”, “code review”, “linting”, “test coverage”
aiaishell, filesystem, browser, browser-ext, websearch, knowledge, task_state, mcp”ML model”, “RAG”, “training”, “neural network”, “embedding”
generalgeneralfilesystem, shell, browser-ext, websearch, messaging, knowledge, notes, tasks, task_state, scheduling, profiles, email-processor, artifacts, artifacts_toolbox, documents, skill-distill, mcp, mcp_admin”browser”, “screenshot”, “telegram”, “send message”, “knowledge base”
pmpmfilesystem, messaging, tasks, knowledge, github, atlassian, skill-distill”project plan”, “estimates”, “timeline”, “deliverables”, “jira”, “confluence”
"Fix the login bug in auth.ts"
→ coding role → filesystem, shell, git tools
"Search the web for React state management best practices"
→ research → research role → websearch, knowledge tools
"Deploy the Docker container to production"
→ devops → devops role → shell, docker, git tools
"Check my Gmail inbox"
→ communication → communication role → google-workspace tools
"Call +1234567890 and tell them the meeting is moved"
→ communication → communication role → voice tool
"Create a daily reminder at 9 AM"
→ automation → automation role → scheduling tool
"Run the test suite"
→ (matched by root agent system prompt) → qa role → browser, shell, docker tools
"Who is my wife?"
→ (matched by root agent system prompt) → general role → profiles tool
"Take a screenshot of my browser"
→ general → general role → browser-ext tool
"Write API documentation for the auth module"
→ writing → writing role → filesystem, knowledge tools
"Scan the app for SQL injection vulnerabilities"
→ security → security role → shell, browser, websearch tools
"Analyze the cost of migrating to AWS"
→ finance → finance role → browser, websearch tools

Special Routing Rules (from root agent system prompt)

Section titled “Special Routing Rules (from root agent system prompt)”

These are prompt guidance and examples, not deterministic routing rules. The general root can perform work itself when its tools suffice:

PatternRoutes ToReason
”use my browser”, “check this website”generalHas browser-ext + messaging
”run tests”, “test suite”qaDiscovers and runs project tests
”review the code”reviewRead-only analysis + linters
”gmail”, “calendar”, “call me”communicationGoogle Workspace + voice
”who is my wife”, “my dog”generalHas profiles tool
”remember this”, “save this”generalStores in profiles + knowledge
”create a schedule”, “every morning”automationBuilt-in scheduling tool

Interactive answers (INLINE-UI.md) are a capability of the client that shows the conversation, so no role carries them. root-runner adds the prompt section and the inline-ui__source tool to the root agent only when the turn offers them: a room, or a personal or space chat whose client sent renders: ["inline_ui"] — never a child, a small model, a vendor CLI root or a group thread. It also strips inline-ui handlers a customised role row brought in when the turn does not offer them.

Roles are the runtime specialization boundary. The root agent can do work with its general role or ask spawn_child for a role whose description matches the subtask. A role owns its prompt, critical rules, tool allowlist and default model lane. The lane is not a role selector: a caller can name a real lane in spawn_child.topic when it needs a different model binding.

The former database expert layer and its /expert worker bypass were retired. The gateway may still expose compatibility commands or proposal records, but they do not change the active child model resolution path.

The role table above lists tool containers, not individual callable functions. Use GET /api/tools, GET /api/tools/all, or GET /api/tools/role-map for current handler names, schemas, and role bindings. Manifests in src/tools/ are authoritative; callable names and permission action names can differ. Tool availability does not authorize execution: ASK needs an attended approval surface or a valid reviewed grant; unattended ASK is blocked.

Planned children use a configured lane executor first; otherwise the lane’s primary binding is used. Unresolved worker bindings fail with a configuration error. The root can use the configured default. See Model routing for executor, backup, and worker path details; model capabilities and routing behavior differ by execution path.


Edit this page in the repository.