Skip to content

feat(agent): architecture router — task-decomposability-based selector (#1139) - #1160

Merged
Lexus2016 merged 1 commit into
mainfrom
evolution/issue-1139-architecture-router
Jul 18, 2026
Merged

feat(agent): architecture router — task-decomposability-based selector (#1139)#1160
Lexus2016 merged 1 commit into
mainfrom
evolution/issue-1139-architecture-router

Conversation

@Lexus2016

Copy link
Copy Markdown
Owner

Closes #1139. Adds an orchestrator router following Google's agent-scaling study (arXiv:2512.08296).

How

  • agent/architecture_router.py
    • classify_task() — heuristic scoring of decomposability / tool density / sequentiality with a confidence signal.
    • route() — decision table (single_agent / centralized_orchestrator / plan_and_execute) + guardrails: low classifier confidence → single-agent; workers capped to contain the error amplification the study documents (17.2× independent-parallel → 4.4× centralized).
    • RouterTelemetry — bounded log of decisions + outcomes (the calibration dataset the issue asks for).
  • conversation_loop._run_conversation_impl — a config-gated pre-flight records the recommended architecture on agent._architecture_route + telemetry in the real turn loop.

Safety / no-regression

  • Observation-only + OFF by default (architecture_router.enabled, documented in cli-config.yaml.example). It logs a recommendation for calibration; it does not change how the turn executes (acting on it is a documented follow-up). When off the pre-flight sets _architecture_route = None and does nothing else. Never raises.
  • Not dead code: executable-seam runtime tests drive the real run_conversation loop (off records nothing / parallelizable task → centralized orchestrator + telemetry / sequential task → plan-and-execute, single worker).

Tests

  • tests/agent/test_architecture_router.py — classifier, decision table across 3 task types, confidence/worker-cap guardrails, telemetry.
  • tests/run_agent/test_architecture_router_runtime.py — executable-seam runtime tests.

Note: the research cycle §1 states all 7 other recommendations were already covered by existing issues; this closes the routing-decision-layer gap.

#1139)

Adds an orchestrator router that classifies each task on two axes
(decomposability + tool density, plus sequentiality) and recommends the optimal
execution architecture, following Google's agent-scaling study (arXiv:2512.08296):
parallelizable tasks favor a centralized orchestrator; sequential tasks are
penalized by multi-agent overhead; independent parallel agents amplify errors.

- agent/architecture_router.py:
  * classify_task() — heuristic decomposability / tool-density / sequentiality
    scoring with a confidence signal.
  * route() — decision table (single_agent / centralized_orchestrator /
    plan_and_execute) + guardrails: low confidence -> single-agent; workers
    capped to contain error amplification (Google: 17.2x -> 4.4x).
  * RouterTelemetry — bounded log of decisions + outcomes (the calibration
    dataset the issue asks for).
  * config + lazy load via load_config_readonly.
- conversation_loop._run_conversation_impl: config-gated pre-flight records the
  recommended architecture on agent._architecture_route + telemetry WITHOUT
  changing turn execution (observation-only). OFF by default -> pure no-op.

Tests: full unit coverage (classifier, decision table for 3 task types,
guardrails, telemetry) + executable-seam runtime tests driving the real
run_conversation loop (off / parallelizable->orchestrator / sequential->plan).
@Lexus2016
Lexus2016 merged commit 684ebf6 into main Jul 18, 2026
35 checks passed
@Lexus2016
Lexus2016 deleted the evolution/issue-1139-architecture-router branch July 18, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Architecture router — empirical single-agent vs. centralized multi-agent selector based on task decomposability and tool density

1 participant