Skip to content

gut: replace routing fallback with explicit failure #1576

@alexey-pelykh

Description

@alexey-pelykh

Context

pickFirstExistingAgentId() (routing/resolve-route.ts:146–161) silently rewrites unknown agent IDs to the default agent. A typo in a binding config routes messages to the wrong agent forever with zero trace. This is the worst bug-hiding behavior in the default-agent concept.

Depends on #1575 (sole-agent auto-selection must exist first).

What

  1. Rewrite pickFirstExistingAgentId() to return null or throw when agent ID not found in config
  2. Change resolveAgentRoute() final fallback (line 718) to return an error route
  3. Single-agent config + no binding match → auto-route to sole agent (convenience preserved)
  4. Multi-agent config + no binding match → explicit error with config guidance

Acceptance Criteria

  • Single-agent config with no matching binding routes to the sole agent
  • Multi-agent config with no matching binding returns error (not silent fallback)
  • Binding referencing unknown agent ID → returns null/throws (not silent remap)
  • resolveAgentRoute() final fallback returns error route with log guidance
  • Tests updated; CI passes

Files

  • src/routing/resolve-route.ts
  • src/routing/bindings.ts (if applicable)
  • src/routing/resolve-route.test.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    gutRemoving dead upstream subsystems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions