Skip to content

fix(discord): add agentComponents to config Zod schema#39378

Merged
thewilloftheshadow merged 1 commit intoopenclaw:mainfrom
gambletan:fix/discord-agent-components-schema
Mar 8, 2026
Merged

fix(discord): add agentComponents to config Zod schema#39378
thewilloftheshadow merged 1 commit intoopenclaw:mainfrom
gambletan:fix/discord-agent-components-schema

Conversation

@gambletan
Copy link
Copy Markdown
Contributor

Summary

  • Adds agentComponents field to DiscordAccountSchema in the Zod config schema
  • Aligns schema with the TypeScript type definition DiscordAccountConfig at types.discord.ts:301

Problem

The agentComponents field is defined in the TypeScript type, actively read at runtime in discord/monitor/provider.ts:544-545, and used in tests — but was missing from the Zod validation schema. Because the schema uses .strict(), users setting channels.discord.agentComponents.enabled: true get an Unrecognized key validation error.

Fixes #35564

Test plan

  • Zod schema tests pass (12/12)
  • Setting channels.discord.agentComponents.enabled: true should be accepted

🤖 Generated with Claude Code

@aisle-research-bot
Copy link
Copy Markdown

aisle-research-bot bot commented Mar 8, 2026

🤖 We're reviewing this PR with Aisle

We're running a security check on the changes in this PR now. This usually takes a few minutes. ⌛
We'll post the results here as soon as they're ready.

Progress:

  • Analysis
  • Triage
  • Finalization

Latest run failed. Keeping previous successful results. Trace ID: 019ccb3aabc61ff0927a71306c7e974d.

Last updated on: 2026-03-08T02:17:12Z

Latest run failed. Keeping previous successful results. Trace ID: 019ccb6d67b5eafd41b5e97790474069.

Last updated on: 2026-03-08T03:11:27Z

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 8, 2026

Greptile Summary

This PR fixes a user-facing validation error by adding the missing agentComponents field to the DiscordAccountSchema Zod schema, aligning it with the existing DiscordAgentComponentsConfig TypeScript type and its active runtime usage in discord/monitor/provider.ts.

  • The new agentComponents sub-schema ({ enabled: z.boolean().optional() }.strict().optional()) exactly matches the DiscordAgentComponentsConfig type, which only exposes enabled?: boolean.
  • The placement in the schema (between execApprovals and ui) mirrors the ordering in the TypeScript interface, maintaining consistency and readability.
  • Without this change, any config containing channels.discord.agentComponents.enabled: true would be rejected at startup with an Unrecognized key error because the parent schema is .strict().
  • The schema uses .strict() and .optional() consistently with every other sub-object in the file.

Confidence Score: 5/5

  • This PR is safe to merge — it is a minimal, targeted schema fix with no logic changes.
  • The change is a single-field addition to a Zod schema that exactly mirrors the existing TypeScript type definition and the runtime code that already reads the field. There are no new behaviors introduced; the only effect is that previously-rejected valid config is now accepted. The schema uses .strict() and .optional() consistently with every other sub-object in the file. Runtime usage is confirmed in provider.ts where agentComponentsConfig is accessed and its enabled property controls whether agent-controlled interactive components are activated.
  • No files require special attention.

Last reviewed commit: 60ea20d

@thewilloftheshadow thewilloftheshadow self-assigned this Mar 8, 2026
@thewilloftheshadow thewilloftheshadow force-pushed the fix/discord-agent-components-schema branch from 60ea20d to 2da9621 Compare March 8, 2026 03:11
@thewilloftheshadow thewilloftheshadow merged commit 9c8e34d into openclaw:main Mar 8, 2026
@thewilloftheshadow
Copy link
Copy Markdown
Member

Landed via temp rebase onto main.

  • Gate: related config tests only (bunx vitest run src/config/config.discord-agent-components.test.ts src/config/schema.test.ts src/config/schema.hints.test.ts)
  • Land commit: 2da9621
  • Source commit: 60ea20d
  • Merge commit: 9c8e34d

Thanks @gambletan!

mrosmarin added a commit to mrosmarin/openclaw that referenced this pull request Mar 8, 2026
* main: (290 commits)
  test: stabilize exec resolver timeout fixture
  chore: add changelog and format fix for openclaw#39414
  fix(chat): preserve sender labels in dashboard history
  docs: clean up latest changelog sections
  docs: dedupe changelog contributor attribution
  fix(ci): resolve current gate regressions
  refactor(voice-call): share tts deep merge
  fix: land openclaw#39337 by @goodspeed-apps for acpx MCP bootstrap
  fix(ci): resolve type regressions on main
  fix: document discord agentComponents schema parity (openclaw#39378) (thanks @gambletan) (openclaw#39378)
  fix(discord): validate agentComponents config
  test: cover daemon probe auth seam
  refactor: preserve explicit mock voice-call values
  refactor: register gateway service adapters
  refactor: reuse shared gateway probe auth
  refactor: split daemon status gathering
  refactor: centralize strict numeric parsing
  refactor: normalize voice-call runtime defaults
  fix(ci): pin multi-arch docker base digests
  docs: add changelog for Telegram DM draft restore (openclaw#39398)
  ...
mcaxtr pushed a commit to mcaxtr/openclaw that referenced this pull request Mar 8, 2026
@gambletan gambletan deleted the fix/discord-agent-components-schema branch March 8, 2026 04:42
Saitop pushed a commit to NomiciAI/openclaw that referenced this pull request Mar 8, 2026
GordonSH-oss pushed a commit to GordonSH-oss/openclaw that referenced this pull request Mar 9, 2026
jenawant pushed a commit to jenawant/openclaw that referenced this pull request Mar 10, 2026
dhoman pushed a commit to dhoman/chrono-claw that referenced this pull request Mar 11, 2026
senw-developers pushed a commit to senw-developers/va-openclaw that referenced this pull request Mar 17, 2026
V-Gutierrez pushed a commit to V-Gutierrez/openclaw-vendor that referenced this pull request Mar 17, 2026
alexey-pelykh pushed a commit to remoteclaw/remoteclaw that referenced this pull request Mar 22, 2026
alexey-pelykh added a commit to remoteclaw/remoteclaw that referenced this pull request Mar 22, 2026
…r live test fixes (#1795)

* Changelog: credit openclaw#39328 to @vincentkoc

(cherry picked from commit 2ec478c)

* Changelog: move openclaw#39328 credit to section end

(cherry picked from commit 5b30c9d)

* Pi Runner: gate parallel_tool_calls to compatible APIs (openclaw#39356)

* Pi Runner: gate parallel_tool_calls payload injection

* Pi Runner: cover parallel_tool_calls alias precedence

* Changelog: note parallel_tool_calls compatibility fix

* Update CHANGELOG.md

* Pi Runner: clarify null parallel_tool_calls override logging

(cherry picked from commit daecd2d)

# Conflicts:
#	CHANGELOG.md
#	src/agents/pi-embedded-runner-extraparams.test.ts
#	src/agents/pi-embedded-runner/extra-params.ts

* docs: add changelog for Telegram DM draft restore (openclaw#39398)

(cherry picked from commit 722c5e5)

* fix: document discord agentComponents schema parity (openclaw#39378) (thanks @gambletan) (openclaw#39378)

Co-authored-by: Shadow <[email protected]>
(cherry picked from commit 9c8e34d)

* fix: land openclaw#39337 by @goodspeed-apps for acpx MCP bootstrap

Co-authored-by: Goodspeed App Studio <[email protected]>
(cherry picked from commit 5659d7f)

# Conflicts:
#	extensions/acpx/openclaw.plugin.json
#	extensions/acpx/src/config.test.ts
#	extensions/acpx/src/config.ts
#	extensions/acpx/src/runtime-internals/test-fixtures.ts
#	extensions/acpx/src/runtime.test.ts
#	extensions/acpx/src/runtime.ts
#	extensions/acpx/src/service.ts

* docs: clean up latest changelog sections

(cherry picked from commit c743fd9)

* fix: land contributor PR openclaw#39516 from @Imhermes1

macOS app/chat/browser/cron/permissions fixes.

Co-authored-by: ImHermes1 <[email protected]>
(cherry picked from commit d15b6af)

# Conflicts:
#	CHANGELOG.md
#	apps/macos/Sources/RemoteClaw/NodeMode/MacNodeBrowserProxy.swift
#	apps/macos/Sources/RemoteClaw/NodeMode/MacNodeModeCoordinator.swift
#	apps/macos/Sources/RemoteClaw/NodeMode/MacNodeRuntime.swift
#	apps/macos/Sources/RemoteClaw/PermissionsSettings.swift
#	apps/macos/Tests/RemoteClawIPCTests/MacNodeBrowserProxyTests.swift
#	apps/shared/RemoteClawKit/Sources/RemoteClawChatUI/ChatView.swift
#	apps/shared/RemoteClawKit/Sources/RemoteClawKit/BrowserCommands.swift
#	apps/shared/RemoteClawKit/Tests/RemoteClawKitTests/ChatComposerPasteSupportTests.swift

* fix: stage docker live tests from mounted source

(cherry picked from commit 21df014)

* fix: add minimal process shim for acpx mcp-agent-command

The upstream process.ts depends on gutted runtime-api, so provide a
minimal spawnAndCollect implementation that satisfies the import.

---------

Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: gambletan <[email protected]>
Co-authored-by: Shadow <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Discord agentComponents config rejected by strict Zod schema

2 participants