← Back to PRs

#10197: fix: add missing allowAgents to agent defaults subagents schema

by Yida-Dev open 2026-02-06 06:51 View on GitHub →
## 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