Repository navigation
[codex] Map ACP thinking to advertised effort key - #79926
Conversation
|
Codex review: needs changes before merge. Summary Reproducibility: yes. Source and dependency inspection show current main sends canonical Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Merge the focused thinking/effort alias mapping after completing the small Do we have a high-confidence way to reproduce the issue? Yes. Source and dependency inspection show current main sends canonical Is this the best way to solve the issue? Yes for the central thinking/effort bug. The alias resolver is narrow and keeps OpenClaw state canonical while sending backend-advertised keys, but Full review comments:
Overall correctness: patch is correct Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against a1fe4ae646eb. |
648192b to
a79fe7b
Compare
a79fe7b to
af0f0f9
Compare
af0f0f9 to
b55015d
Compare
b55015d to
f954cb0
Compare
|
Landed via rebase onto Proof:
Thanks @InTheCloudDan! |
Summary
session/set_config_option.thinking,permissionProfile,timeoutSeconds) while supporting backend wire aliases such aseffort,reasoning_effort,thought_level,permissions, andtimeout_seconds.setSessionConfigOptionupdates.Root Cause
Claude ACP advertises
effortinstead ofthinking. OpenClaw persisted the abstract runtime option asthinking, then rejected the pre-turn config update because the backend advertised a strict key list that did not containthinking. In a fresh real acpx Claude session, capabilities can also omitconfigOptionKeyswhilesession/status.details.configOptionsadvertisesmode,model, andeffort; this path still needed the same canonical-to-wire-key translation. The inverse parser also treated plaineffortas an opaque backend extra instead of canonical thinking state.Real behavior proof (required for external PRs)
Behavior or issue addressed:
Claude ACP/acpx rejects the OpenClaw canonical runtime option key
thinkingbecause the real adapter advertiseseffortinstead. This patch maps canonical OpenClaw thinking state to the backend-advertised wire key while keeping persisted OpenClaw runtime options canonical.Real environment tested:
Local OpenClaw gateway/install on May 9, 2026 after hot-patching the installed
2026.5.9-beta.1bundle with this branch's ACP control-plane changes and restarting the LaunchAgent gateway.openclaw --versionreportedOpenClaw 2026.5.9-beta.1 (0d3141e). Gateway was2026.5.9-beta.1, LaunchAgent pid14036, using the NVM install at/Users/danobrien/.nvm/versions/node/v24.13.0/lib/node_modules/openclaw/dist/index.js. The acpx plugin was@openclaw/[email protected], dependency[email protected], with@agentclientprotocol/[email protected].Exact steps or command run after this patch:
Patched the installed OpenClaw gateway bundle with this branch's control-plane changes, ran
node --check /Users/danobrien/.nvm/versions/node/v24.13.0/lib/node_modules/openclaw/dist/manager-CgmKcnsi.js, restarted the real gateway with/Users/danobrien/.nvm/versions/node/v24.13.0/bin/openclaw gateway restart, then ran a one-offnode --input-type=modulescript that imported the installed OpenClaw config/session manager, loaded the installed@openclaw/acpxruntime service, initialized a fresh real Claude ACP session, calledmanager.setSessionConfigOption({ key: "thinking", value: "low" }), calledmanager.setSessionConfigOption({ key: "thinking", value: "high" }), read status, and closed/cleared the proof session.Evidence after fix (screenshot, recording, terminal capture, console output, redacted runtime log, linked artifact, or copied live output):
Copied live terminal output from the fresh real Claude ACP session:
{ "proofTimestamp": "2026-05-09T19:10:04.918Z", "openclawVersion": "2026.5.9-beta.1 (installed gateway package)", "acpxPluginVersion": "2026.5.9-beta.1", "acpxDependencyVersion": "0.7.0", "sessionKey": "agent:claude:acp:proof-thinking-4fc9ed05-b157-411e-89f8-bc1a58650560", "backend": "acpx", "agent": "claude", "runtimeSessionName": "acpx:v2:<redacted>", "acpxRecordId": "agent:claude:acp:proof-thinking-4fc9ed05-b157-411e-89f8-bc1a58650560", "backendSessionId": "de61dc19-2381-4773-8a31-3eede62f57c7", "advertisedConfigKeysFromStatus": [ "mode", "model", "effort" ], "beforeRuntimeOptions": { "cwd": "/Users/danobrien/.openclaw/workspace" }, "setThinkingLowReturned": { "thinking": "low", "cwd": "/Users/danobrien/.openclaw/workspace" }, "setThinkingHighReturned": { "thinking": "high", "cwd": "/Users/danobrien/.openclaw/workspace" }, "afterRuntimeOptions": { "thinking": "high", "cwd": "/Users/danobrien/.openclaw/workspace" }, "runtimeStatusSummary": "session=agent:claude:acp:proof-thinking-4fc9ed05-b157-411e-89f8-bc1a58650560 backendSessionId=de61dc19-2381-4773-8a31-3eede62f57c7 pid=14549 open", "cleanup": { "runtimeClosed": true, "metaCleared": true } }Observed result after fix:
The real Claude ACP adapter advertised
effort, notthinking, while bothsetSessionConfigOption({ key: "thinking" })calls completed successfully. OpenClaw returned and persisted canonicalthinkingruntime state (low, thenhigh) instead of surfacing the previous ACPInternal error/Unknown config option: thinkingfailure. The proof session was closed and metadata was cleared after the check.What was not tested:
No known gaps for the Claude/acpx regression path. Gemini and Codex provider dialects were covered by manager regression tests, but I did not run live Gemini or Codex ACP sessions in this local proof.
Before evidence (optional but encouraged):
Before the status-derived key refinement, the same real local Claude/acpx path reproduced the original failure as
AcpRuntimeError: Internal error, caused by ACP data{ details: "Unknown config option: thinking" }.Validation
pnpm exec oxfmt --check src/acp/control-plane/manager.core.ts src/acp/control-plane/manager.runtime-controls.ts src/acp/control-plane/manager.test.tsgit diff --checkpnpm vitest src/acp/control-plane/manager.test.tspnpm tsgo:core:test