Skip to content

fix(config): add approvalRunningNoticeMs to ToolExecBaseShape#1652

Open
BingqingLyu wants to merge 6 commits into
mainfrom
fork-pr-57293-fix-tools-exec-approval-running-notice-schema
Open

fix(config): add approvalRunningNoticeMs to ToolExecBaseShape#1652
BingqingLyu wants to merge 6 commits into
mainfrom
fork-pr-57293-fix-tools-exec-approval-running-notice-schema

Conversation

@BingqingLyu

@BingqingLyu BingqingLyu commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • tools.exec.approvalRunningNoticeMs was documented and implemented in the runtime but missing from ToolExecBaseShape in the Zod schema, so ToolExecSchema (used for the global tools.exec path) rejected it as an unrecognized key under .strict() mode
  • Moves approvalRunningNoticeMs into ToolExecBaseShape so both the global tools.exec schema (ToolExecSchema) and per-agent exec config (AgentToolExecSchema) accept the field
  • Regenerates schema.base.generated.ts to reflect the fix

Fixes

Closes openclaw#57270

Root cause

In zod-schema.agent-runtime.ts, ToolExecBaseShape is the shared shape for both ToolExecSchema (tools.exec) and AgentToolExecSchema (per-agent exec). The field was accidentally added only to AgentToolExecSchema extra fields rather than to the shared base, so it was accepted for agent-level config but rejected for global tools.exec.

Test plan

  • pnpm config:schema:check passes
  • vitest run src/config/ — 889 tests pass; 1 pre-existing Windows symlink failure in load-channel-config-surface.test.ts unrelated to this change
  • vitest run src/config/schema.help.quality.test.ts passes (20/20)
  • vitest run src/config/schema.base.generated.test.ts passes
  • Runtime: ToolsSchema.safeParse({ exec: { approvalRunningNoticeMs: 3000 } }) returns success: true
  • Runtime: .strict() mode still rejects unknown keys

AI-assisted

  • Generated with Claude Code (claude-sonnet-4-6)
  • Testing level: fully tested (runtime + unit tests)
  • I understand what the code does

🤖 Generated with Claude Code

natedemoss and others added 6 commits March 26, 2026 11:11
…d units

The gateway installer was writing secret values from ~/.openclaw/.env
directly into the systemd unit file as inline Environment= directives.
This meant that any backup of the service file (e.g. .bak files) would
also contain the secrets in plaintext, and the openclaw doctor audit
tool would flag the resulting config as non-standard.

This change adds an environmentFile field to GatewayServiceRenderArgs
and teaches buildSystemdUnit to emit EnvironmentFile= when that field is
set. writeSystemdUnit now detects the .env file, references it via
EnvironmentFile=, and filters its keys out of the inline environment so
they are no longer duplicated in the unit file.

Fixes: openclaw#54521
tools.exec.approvalRunningNoticeMs was only in AgentToolExecSchema
(per-agent exec config) but missing from ToolExecBaseShape, so
ToolExecSchema (.strict()) rejected it as an unrecognized key at
the global tools.exec level.

Moving the field to ToolExecBaseShape makes it available in both
the global tools.exec schema and per-agent exec configs, matching
the documented behavior and the ExecToolConfig TypeScript type.

Regenerated schema.base.generated.ts to reflect the fix.

Fixes openclaw#57270

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
- Reject EnvironmentFile paths containing whitespace, which systemd
  treats as a field separator and would silently produce an invalid
  unit file (expands the existing \r\n check to all whitespace)
- Narrow the .env access catch to ENOENT only so unexpected errors
  (EACCES, parse failures, etc.) are not silently swallowed and do
  not cause secrets to be inlined as a silent fallback

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tools.exec.approvalRunningNoticeMs is documented but rejected by the 2026.3.24 config schema

2 participants