Skip to content

gut(agents): remove default field from AgentConfig, introduce sole-agent auto-selection#2274

Merged
alexey-pelykh merged 1 commit intomainfrom
gut/remove-default-agent-field
Apr 11, 2026
Merged

gut(agents): remove default field from AgentConfig, introduce sole-agent auto-selection#2274
alexey-pelykh merged 1 commit intomainfrom
gut/remove-default-agent-field

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Summary

  • Remove default?: boolean from AgentConfig type and zod schema
  • Add resolveSoleAgentId(cfg) — returns agent ID when exactly one is configured, null otherwise
  • Add requireSoleAgentId(cfg) — throws descriptive error for zero or multiple agents
  • Deprecate resolveDefaultAgentId() as a temporary shim delegating to resolveSoleAgentId (removed once all callers migrate in gut: replace routing fallback with explicit failure #1576gut: config migration for deprecated default: true field #1581)
  • Update inline default-resolution in main-session.ts, legacy.shared.ts, legacy.rules.ts, agent-dirs.ts, and thread-ownership extension
  • Remove default: true from all test fixtures across 19 test files

Test plan

  • New resolveSoleAgentId tests: returns ID for single agent, null for zero/empty/multiple
  • New requireSoleAgentId tests: returns ID for single, throws for zero/empty/multiple with descriptive messages
  • Existing tests updated to remove default: true from config fixtures
  • Full test suite passes (5926 tests, 693 files)
  • Build passes
  • Lint passes (oxlint type-aware)
  • Format passes (oxfmt)

Closes #1575

🤖 Generated with Claude Code

…agent auto-selection (#1575)

Remove the `default: boolean` field from `AgentConfig` type and zod schema.
Introduce `resolveSoleAgentId()` (returns agent ID when exactly one is
configured, null otherwise) and `requireSoleAgentId()` (throws for zero
or multiple agents). Deprecate `resolveDefaultAgentId()` as a temporary
shim delegating to the new function — callers migrate in #1576#1581.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alexey-pelykh alexey-pelykh enabled auto-merge (squash) April 11, 2026 08:26
@alexey-pelykh alexey-pelykh merged commit d60ca6e into main Apr 11, 2026
10 checks passed
@alexey-pelykh alexey-pelykh deleted the gut/remove-default-agent-field branch April 11, 2026 08:31
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: remove default field from AgentConfig and introduce sole-agent auto-selection

1 participant