Default agentConfig to {} so permissions default propagates

When agentConfig is absent from YAML, .optional() leaves it undefined,
so project.agentConfig?.permissions evaluates to undefined instead of
"skip". Change to .default({}) so Zod always constructs the object and
applies the inner permissions default.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Prateek 2026-02-27 19:02:22 +05:30
parent 359e759376
commit 482e7f7923
1 changed files with 1 additions and 1 deletions

View File

@ -74,7 +74,7 @@ const ProjectConfigSchema = z.object({
scm: SCMConfigSchema.optional(),
symlinks: z.array(z.string()).optional(),
postCreate: z.array(z.string()).optional(),
agentConfig: AgentSpecificConfigSchema.optional(),
agentConfig: AgentSpecificConfigSchema.default({}),
reactions: z.record(ReactionConfigSchema.partial()).optional(),
agentRules: z.string().optional(),
agentRulesFile: z.string().optional(),