Repository navigation
feat: implement OpenClaw as sandbox external agent (#2420) - #2555
Merged
Merged
Conversation
yannickmonney
enabled auto-merge (squash)
July 7, 2026 12:12
yannickmonney
added a commit
that referenced
this pull request
Jul 7, 2026
…leet The budget was set at 4400 MB when the image was ~4.0 GB; the six external agent CLIs added since (Cursor #2481, Hermes #2500, Gemini #2535, Codex #2536, Pi #2550, OpenClaw #2555) grew it to ~4.9 GB and none of those PRs updated the budget, so the Validate images gate is red on main too. Document the fleet as a named cost and restore the ~10% headroom convention at 5400.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements OpenClaw (
agentKind: "openclaw") as a sandbox external agent on the same seam as Claude Code / OpenCode / Hermes / Gemini CLI / Codex.Closes #2420
What's here
lib/agent-adapters/openclaw/(buildExec+createParser), pinned to openclaw 2026.6.11, every mechanism verified against the clonedv2026.6.11source and a real local run of the pinned CLI.services/sandbox-runtime/tale-openclaw-run. The pinned CLI has no streaming output headlessly (openclaw agent --local --jsonprints ONE final envelope), so the wrapper owns the translation into Tale NDJSON lifecycle events (run_start/assistant_message/usage/run_end) and stages the three inputs that have no CLI flag: the generated config (OPENCLAW_CONFIG_PATH), the prompt (--message-file— never argv), and the system-prompt append (workspaceAGENTS.md, backed up/restored around the run).models.providers.taleconfig pointing at the gateway's OpenAI-compatible route; the session VK rides OpenClaw's native${TALE_GATEWAY_TOKEN}SecretInput env template, so the staged config never contains the key. Native web tools (web_search/web_fetch/x_search) denied unlessnativeWebTools: true;tools.profile: "coding"already excludes messaging/gateway tools; catalogfallbackModelIdarmed via OpenClaw's nativemodel.fallbackschain (VK-allowed alongside the primary).ANTHROPIC_API_KEY/OPENAI_API_KEY/OPENROUTER_API_KEYnatively;byoModelIdSource: 'catalog'(OpenClaw refs arevendor/model, the catalog id's grammar; raw user-typed ids pass through).--session-id(persisted session keyagent:main:explicit:<handle>underOPENCLAW_STATE_DIR=/user/.runtime/home/.openclaw); same handle resumes the same conversation across turns.codex), agent editor kind picker,builtin-configs/agents/chat/openclaw.json(composer order 46), locales en/de/fr, docs en/de/fr, sandbox image install + wrapper + container-runtime checks.<state>/skills, SKILL.md format — Claude-compatible). MCP: Playwright (headless or CDP) + the integrations dispatch bridge viamcp.servers.Verified against the real pinned CLI (local, mock OpenAI-compatible gateway)
Ran
tale-openclaw-runend-to-end with the adapter's exact stdin payload against[email protected]:<base>/openai/v1/chat/completionswithAuthorization: Bearer <VK>(the${TALE_GATEWAY_TOKEN}template resolves) and the slashed gateway model id survived (tale/openrouter/anthropic/claude-sonnet-4.6);AGENTS.mdsystem-prompt append appeared in the request's system message alongside OpenClaw's core prompt, and was restored/cleaned from the workspace afterwards;--resume <handle>carried the prior user+assistant turns (session resume);codingprofile removedmessage/gateway/…; deny removedweb_fetch/web_search);fixtures/openclaw/hello-turn.jsonlis the sanitized capture of that run; the container-runtime test's flag check (openclaw agent --helpvs wrapper flags) also passes against the pinned CLI locally.Gates run locally: platform typecheck, adapter/parser/schema/exec-model/readiness/i18n/builtin-agent test suites (all green), model-selector UI test, docs test suite,
migrations:check,oxfmt --check, ruff, oxlint (type-aware),knip,lint:sast.Honest parity gaps (CLI limitations at the pinned version, documented in the docs page)
--jsonis a single final envelope, so a turn renders as run-started → final text → usage → result (no in-run tool timeline). The internal event stream exists only behind the gateway WebSocket/ACP, which would require a daemon in the container; deliberately out of scope.maxTurnsignored — the CLI has no per-run tool-iteration cap; the platform exec deadline is the runaway backstop (CLI's own 600 s default disabled via--timeout 0).openclaw --version, wrapper present, flag parity withagent --help).