fix(acpx): pass MCP server configuration to ACP sessions#39337
fix(acpx): pass MCP server configuration to ACP sessions#39337goodspeed-apps wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR fixes a bug where the ACPX runtime always passed an empty
The implementation is correct and well-tested. One minor code quality issue: an unused destructured variable Confidence Score: 4/5
Last reviewed commit: 628ba1e |
| for (const [key, val] of Object.entries(value.env)) { | ||
| if (typeof val !== "string") return false; | ||
| } |
There was a problem hiding this comment.
The variable key is destructured but never used. This will trigger TypeScript's noUnusedLocals (or ESLint equivalent) warnings. Prefix with an underscore to suppress:
| for (const [key, val] of Object.entries(value.env)) { | |
| if (typeof val !== "string") return false; | |
| } | |
| for (const [_key, val] of Object.entries(value.env)) { | |
| if (typeof val !== "string") return false; | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/acpx/src/config.ts
Line: 93-95
Comment:
The variable `key` is destructured but never used. This will trigger TypeScript's `noUnusedLocals` (or ESLint equivalent) warnings. Prefix with an underscore to suppress:
```suggestion
for (const [_key, val] of Object.entries(value.env)) {
if (typeof val !== "string") return false;
}
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 628ba1eaad
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| }), | ||
| cwd, | ||
| fallbackCode: "ACP_SESSION_INIT_FAILED", | ||
| mcpServers: this.config.mcpServers, |
There was a problem hiding this comment.
Pass MCP server config on the main ensure-session path
mcpServers is only attached in the fallback sessions new branch, but ensureSession first calls sessions ensure and accepts that result whenever it already returns session IDs (the normal behavior). In that common path, the CLI never receives --mcpServers, so configured MCP servers are still not applied to sessions despite this change.
Useful? React with 👍 / 👎.
xkonjin
left a comment
There was a problem hiding this comment.
Quick review pass:
- Main risk area here is auth/session state and stale credential handling.
- Good to see test coverage move with the code; I’d still make sure it exercises the unhappy path around auth/session state and stale credential handling rather than only the happy path.
- Before merge, I’d smoke-test the behavior touched by openclaw.plugin.json, config.test.ts, config.ts (+2 more) with malformed input / retry / rollback cases, since that’s where this class of change usually breaks.
- Cancellation paths are notoriously flaky; a deterministic test proving cleanup happens on abort/timeout would reduce regression risk.
Co-authored-by: Goodspeed App Studio <[email protected]>
|
Landed on main in 5659d7f. The original PR direction exposed the right config surface, but bundled acpx 0.1.15 does not support a Validated with:
Landed commit: Source commit: Thanks @goodspeed-apps. |
* 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) ...
Co-authored-by: Goodspeed App Studio <[email protected]>
Co-authored-by: Goodspeed App Studio <[email protected]>
Co-authored-by: Goodspeed App Studio <[email protected]>
Co-authored-by: Goodspeed App Studio <[email protected]>
Co-authored-by: Goodspeed App Studio <[email protected]>
Co-authored-by: Goodspeed App Studio <[email protected]>
Co-authored-by: Goodspeed App Studio <[email protected]>
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
…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]>
Problem
The ACPX runtime was ignoring MCP server configurations, always passing
mcpServers: []to the underlying acpx CLI. This prevented users from using external MCP servers like Canva's MCP with OpenClaw's ACP runtime.Solution
This PR adds support for configuring MCP servers in the ACPX plugin configuration and passes them to the acpx CLI when creating new sessions.
Changes
McpServerConfigtype and validationTesting
config.test.tswith tests for config validationFixes #39225