#10197: fix: add missing allowAgents to agent defaults subagents schema
Cluster:
Compaction Enhancements and Features
## Summary
- `subagents.allowAgents` was defined in the per-agent runtime schema (`zod-schema.agent-runtime.ts`) but missing from the agent defaults schema (`zod-schema.agent-defaults.ts`) and its type definition (`types.agent-defaults.ts`)
- Because the defaults schema uses `.strict()`, any config containing `agents.defaults.subagents.allowAgents` was silently stripped during validation
- This meant `sessions_spawn` always saw an empty `allowAgents` array and rejected all spawn requests when configured via defaults
- Added `allowAgents: z.array(z.string()).optional()` to the defaults Zod schema and `allowAgents?: string[]` to the TypeScript type
## Test plan
- [x] Added test: schema accepts `allowAgents` with wildcard `["*"]`
- [x] Added test: schema accepts `allowAgents` with specific agent ids
- [x] Added test: schema rejects non-string array values in `allowAgents`
- [x] All existing tests pass
Closes #10031
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds `subagents.allowAgents` to the agent defaults config surface so it is no longer dropped by the defaults `.strict()` Zod schema.
Concretely:
- Extends `src/config/zod-schema.agent-defaults.ts` so `agents.defaults.subagents.allowAgents` can be provided (as an optional `string[]`).
- Extends the corresponding TS type in `src/config/types.agent-defaults.ts`.
- Adds a small Vitest file to cover accept/reject behavior for `allowAgents` values.
This aligns the defaults schema/type with the already-supported per-agent runtime schema, allowing `sessions_spawn` to see the intended allowlist when configured via defaults.
<h3>Confidence Score: 4/5</h3>
- This PR looks safe to merge and is a narrow schema/type fix.
- Changes are limited to adding an optional field in the defaults schema/type plus straightforward schema parsing tests; no runtime logic changes. Only remaining uncertainty is local test execution in this environment (pnpm not available here), but the test code is simple and consistent with existing patterns.
- No files require special attention
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#14640: feat(agents): support per-agent temperature and maxTokens in agents...
by lailoo · 2026-02-12
80.9%
#17921: feat: add spawnableBy bidirectional sub-agent spawn authorization
by jacobot01 · 2026-02-16
79.3%
#14734: test(agents): guard against stale allowAgents in existing sessions
by davidahmann · 2026-02-12
79.1%
#8313: feat: auto-compaction support for spawned subagent sessions
by vishaltandale00 · 2026-02-03
78.6%
#12808: docs(subagents): clarify allowAgents is per-agent only
by JBrady · 2026-02-09
77.6%
#10943: fix(config): resolve Control UI "Unsupported schema node" for confi...
by kraftbj · 2026-02-07
77.4%
#16964: test: add regression tests for sub-agent session path resolution
by StressTestor · 2026-02-15
77.4%
#14934: fix: add mistral to MemorySearchSchema provider/fallback unions
by ThomsenDrake · 2026-02-12
77.4%
#17788: fix: correct config path in sessions_spawn error hint (v2)
by Limitless2023 · 2026-02-16
77.3%
#21558: config: support agents.list[].thinkingDefault
by Uarmagan · 2026-02-20
76.9%