Skip to content

gut(routing): replace routing fallback with explicit failure#2285

Merged
alexey-pelykh merged 1 commit intomainfrom
gut/routing-explicit-failure
Apr 11, 2026
Merged

gut(routing): replace routing fallback with explicit failure#2285
alexey-pelykh merged 1 commit intomainfrom
gut/routing-explicit-failure

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Summary

  • Replaces the silent default-agent fallback in resolveAgentRoute() with explicit sole-agent auto-selection and error routes
  • Rewrites pickFirstExistingAgentId()resolveExistingAgentId() that returns null when an agent ID is not found in config (no more silent remap to default)
  • Single-agent config with no binding match → auto-routes to sole agent (matchedBy: "sole-agent"); multi-agent config with no binding match → returns error route with config guidance
  • Updates all test configs across routing, slack, signal, imessage, and feishu to include an agents list where routing is exercised

Closes #1576

Test plan

  • All 43 resolve-route tests pass (5 new tests for error routes and sole-agent auto-selection)
  • Full unit test suite passes (5927 pass, 1 pre-existing canvas-host failure)
  • TypeScript type check passes (tsgo --noEmit)
  • Lint passes (oxlint --type-aware: 0 warnings, 0 errors)
  • Format check passes (oxfmt --check)
  • CI build passes
  • CI test passes

🤖 Generated with Claude Code

Replace the silent default-agent fallback in resolveAgentRoute() with
explicit sole-agent auto-selection and error routes:

- Rewrite pickFirstExistingAgentId() → resolveExistingAgentId() that
  returns null when an agent ID is not found in config (no silent remap)
- Single-agent config with no binding match → auto-route to sole agent
  (matchedBy: "sole-agent")
- Multi-agent config with no binding match → error route with guidance
- Binding referencing unknown agent ID → error route (not silent remap)
- Remove "default" from matchedBy union, add "sole-agent" | "error"
- Add error field to ResolvedAgentRoute for config guidance messages
- Update all test configs to include agents list where routing is used

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alexey-pelykh alexey-pelykh enabled auto-merge (squash) April 11, 2026 10:10
@alexey-pelykh alexey-pelykh merged commit cd6324e into main Apr 11, 2026
10 checks passed
@alexey-pelykh alexey-pelykh deleted the gut/routing-explicit-failure branch April 11, 2026 10:16
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.

gut: replace routing fallback with explicit failure

1 participant