Skip to content

Fix sandbox setupCommand array newline normalization#31953

Merged
steipete merged 1 commit intoopenclaw:mainfrom
liuxiaopai-ai:fix/sandbox-setupcommand-array-newlines
Mar 2, 2026
Merged

Fix sandbox setupCommand array newline normalization#31953
steipete merged 1 commit intoopenclaw:mainfrom
liuxiaopai-ai:fix/sandbox-setupcommand-array-newlines

Conversation

@liuxiaopai-ai
Copy link

Summary

  • accept agents.*.sandbox.docker.setupCommand as either a string or an array of strings
  • normalize array input by joining entries with newlines so multi-command setup scripts remain valid
  • add regression coverage for array normalization and record the fix in CHANGELOG

Testing

  • pnpm test src/config/config.sandbox-docker.test.ts
  • pnpm tsgo

Fixes #31932.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 2, 2026

Greptile Summary

This PR adds support for specifying agents.*.sandbox.docker.setupCommand as either a string or an array of strings, normalizing arrays by joining with newlines to create valid multi-command shell scripts.

The implementation is clean and correct:

  • Zod schema properly accepts both string and string array inputs
  • Array normalization transforms arrays to newline-delimited strings that work with sh -lc execution
  • Test validates the core functionality with a realistic multi-step setup example
  • CHANGELOG accurately documents the fix
  • Type documentation updated to reflect array support

The change maintains backward compatibility (strings still work) and properly addresses issue #31932 where array entries were concatenating without separators.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Simple, well-tested change that adds optional array support to existing string field with proper normalization. Maintains backward compatibility and includes regression test coverage.
  • No files require special attention

Last reviewed commit: 30dc547

@steipete steipete force-pushed the fix/sandbox-setupcommand-array-newlines branch from 30dc547 to 32e4558 Compare March 2, 2026 18:11
@steipete steipete merged commit 9b8e642 into openclaw:main Mar 2, 2026
1 check passed
@steipete
Copy link
Contributor

steipete commented Mar 2, 2026

Landed via temp rebase onto main.

  • Gate: bunx vitest run src/config/config.sandbox-docker.test.ts
  • Land commit: 32e4558
  • Merge commit: 9b8e642

Thanks @liuxiaopai-ai!

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

Labels

docker Docker and sandbox tooling size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Sandbox setupCommand array joined without newline separators, causing shell syntax errors

2 participants