Skip to content

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

Closed
Yida-Dev wants to merge 1 commit into
openclaw:mainfrom
Yida-Dev:fix/agent-defaults-allow-agents-schema
Closed

fix: add missing allowAgents to agent defaults subagents schema#10197
Yida-Dev wants to merge 1 commit into
openclaw:mainfrom
Yida-Dev:fix/agent-defaults-allow-agents-schema

Conversation

@Yida-Dev

@Yida-Dev Yida-Dev commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

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

  • Added test: schema accepts allowAgents with wildcard ["*"]
  • Added test: schema accepts allowAgents with specific agent ids
  • Added test: schema rejects non-string array values in allowAgents
  • All existing tests pass

Closes #10031

🤖 Generated with Claude Code

Greptile Overview

Greptile Summary

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.

Confidence Score: 4/5

  • 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

The `subagents.allowAgents` field was defined in the per-agent runtime
schema but missing from the agent defaults schema and type definition.
This caused `sessions_spawn` to always reject requests when users set
`agents.defaults.subagents.allowAgents` through the config editor, since
the `.strict()` Zod validator stripped the unrecognized field.

Closes openclaw#10031

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@BuffMcBigHuge

Copy link
Copy Markdown

I discovered this issue as well.

@BuffMcBigHuge

Copy link
Copy Markdown

@mverrilli

mverrilli commented Feb 8, 2026

Copy link
Copy Markdown
Contributor

Confirmed this PR fixes my issue.

@Yida-Dev

Yida-Dev commented Feb 9, 2026

Copy link
Copy Markdown
Contributor Author

Glad to hear the fix works for you @mverrilli and @BuffMcBigHuge! Thanks for confirming. The missing allowAgents field in the defaults schema was indeed causing subagent configs to be silently rejected.

@ethduke

ethduke commented Feb 20, 2026

Copy link
Copy Markdown

Confirming this is still needed on 2026.2.19-2 (45d9b20), Linux/EC2.

Hit this tonight, agents.defaults.subagents.allowAgents rejected by schema validation, sessions_spawn returns forbidden (allowed: none). The per-agent workaround (putting allowAgents in agents.list[].subagents instead of defaults) works, but forces users to create an explicit agents.list entry even for single-agent setups.
This has been broken across every version since 2026.2.3-1. The fix here is correct and minimal. Would be great to get this merged — it's blocking multi-agent workflows for everyone using the defaults config path.

@mudrii

This comment was marked as spam.

@haydonryan

Copy link
Copy Markdown

ALso hit this and really want this PR to be merged!

@MatiasMartinez90

Copy link
Copy Markdown

We are also blocked by this. Running a multi-agent setup with 5+ directors and workers communicating via Slack channels as a workaround because sessions_spawn with agentId fails. The allowAgents key in agents.defaults.subagents causes a schema validation error and CrashLoopBackOff. Would really appreciate this getting merged, it would simplify our entire agent-to-agent communication architecture. Thanks!

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Mar 12, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #pr-thunderdome-dangerzone on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Marked as stale due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: sessions_spawn blocked by config schema mismatch

7 participants