Skip to content

fix(openclaw): batch config set calls into single exec - #3319

Merged
AhmedTMM merged 3 commits into
OpenRouterLabs:mainfrom
AhmedTMM:fix/openclaw-batch-config
Apr 18, 2026
Merged

fix(openclaw): batch config set calls into single exec#3319
AhmedTMM merged 3 commits into
OpenRouterLabs:mainfrom
AhmedTMM:fix/openclaw-batch-config

Conversation

@AhmedTMM

Copy link
Copy Markdown
Collaborator

Summary

Batches 4 separate runner.runServer() calls for OpenClaw config into a single exec. Fixes the connection flakiness you saw on Sprite where the gateway start fails with "connection closed" / "context deadline exceeded" after too many sequential execs.

Before (4 execs)

exec 1: openclaw config set agents.defaults.model.primary ...
exec 2: openclaw config set agents.defaults.sandbox.mode off
exec 3: openclaw config set browser.executablePath ...; browser.noSandbox ...; browser.headless ...; browser.defaultProfile ...
exec 4: openclaw config set channels.telegram.enabled true; channels.whatsapp.enabled true; ... (7 channels)

Each exec = a separate sprite exec session. 14 total openclaw config set calls across 4 sessions → 14 "Config overwrite" log lines → connection pool exhausted → gateway start fails.

After (1 exec)

exec 1: openclaw config set model ...; sandbox ...; browser.executablePath ...; browser.noSandbox ...; browser.headless ...; browser.defaultProfile ...; channels.telegram ...; channels.whatsapp ...; ...

All config sets in one session. Same result, 3 fewer Sprite exec connections before the gateway start.

Non-lossy guarantee

Commands are chained with ; (not &&), so if any individual config set fails (e.g. browser path not found because Chrome wasn't selected), the rest still run. This matches the previous behavior where each call was wrapped in asyncTryCatchIf with non-fatal warnings.

Test plan

  • bunx biome check — 0 errors
  • bun test — 2070/2070 pass
  • Manual: spawn openclaw sprite — verify config writes succeed in one batch, gateway starts without connection drops

Merges 4 separate runner.runServer() calls (model, sandbox, browser,
channel stubs) into one exec with commands chained by `;`. On Sprite
(container-exec, not persistent SSH), many sequential execs exhaust the
connection and cause "connection closed" / "context deadline exceeded"
on later steps like gateway startup.

Before: 4 execs → 14 "Config overwrite" log lines → flaky connection
After:  1 exec  → same config result → stable connection for gateway

Individual commands use `;` not `&&` so a failure in one (e.g. browser
path not found) doesn't skip the rest — these are all non-fatal prefs.

Bumps 1.0.15 -> 1.0.16.
@AhmedTMM
AhmedTMM force-pushed the fix/openclaw-batch-config branch from d1171cc to e33d40f Compare April 17, 2026 22:02

@la14-1 la14-1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security review: Safe to merge. Changes batch 4 sequential openclaw config set execs into 1. No user input interpolation — all values come from hardcoded config objects. Commands chained with `;" matches prior error-tolerant behavior. CI green (all 5 checks). LGTM.

@AhmedTMM
AhmedTMM merged commit dc4fb59 into OpenRouterLabs:main Apr 18, 2026
5 checks passed
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.

2 participants