You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1b9d3ac
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix(claude-cli): apply thinking and keep live sessions warm (#125528)
* fix(models): preserve CLI runtime thinking capabilities
* fix(models): preserve configured thinking overrides
* fix: keep Claude live CLI process warm across captured turns
MCP delivery capture no longer kills the warm Claude process after every
turn. Capture-key admission is fenced by grant activate/deactivate so
prompt-cache continuity can survive across messages.
Co-authored-by: Cursor <[email protected]>
* fix(claude-cli): apply thinking levels
* fix(claude-cli): materialize thinking capabilities
* test(claude-cli): cover warm thinking budget reuse
* test(models): restore prepared catalog contracts
* fix(agents): restore catalog test boundaries
* fix(agents): break prepared catalog import cycle
* refactor(gateway): extract model-choice runtime resolution into public-projection module
Keeps models-list-result.ts under the max-lines cap after the origin/main
merge by moving resolveModelChoiceAgentRuntime next to the projection
helpers it feeds.
Claude-Session: https://claude.ai/code/session_01QXUQuDVataA5o16kxNnmoX
* test(claude-cli): cover thinking cache reuse
* test(claude-cli): cover captured live reuse
* fix(claude-cli): rotate MCP grants across live turns
* fix(anthropic): respect mandatory adaptive thinking
* fix(claude-cli): restore warm MCP bearer
* fix(anthropic): keep Mythos adaptive thinking
* test(claude-cli): prove live MCP cache reuse
* test(claude-cli): align live cache coverage
* fix(claude-cli): reuse live sessions across MCP grant rotation
* test(claude-cli): satisfy cache lane static gates
* fix(claude-cli): preserve runtime thinking policy
* fix(thinking): honor concrete runtime policy
* fix(gateway): honor mandatory thinking in model list
* refactor(auto-reply): extract prepared catalog merge
* docs(cli-backend): document thinking execution input
* refactor(auto-reply): extract catalog lookup helper
* style(auto-reply): format catalog helper import
* fix(claude-cli): stabilize live context budget
* fix(auto-reply): type prepared context metadata
---------
Co-authored-by: VACInc <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>
Copy file name to clipboardExpand all lines: docs/gateway/cli-backends.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -149,7 +149,7 @@ Under a restrictive policy, Claude asks OpenClaw over stdio before using one of
149
149
150
150
Claude Code can drive a Chrome browser through the [Claude in Chrome extension](https://code.claude.com/docs/en/chrome), including [1Password for Claude](/gateway/1password#browser-sign-in-with-1password-for-claude) credential autofill. The bundled backend does not enable it; register a [CLI backend plugin](/plugins/cli-backend-plugins) that appends `--chrome` to the launch args of a `claude-stream-json`-dialect backend. OpenClaw preserves a configured `--chrome` on normal runs and always forces `--no-chrome` on runs with a restricted tool policy, such as side questions. The Chrome window, the extension, and any 1Password approval prompts live on the gateway host, so someone must be at that machine to approve credential use.
151
151
152
-
The backend also maps OpenClaw `/think` levels to Claude Code's native `--effort` flag: `minimal`/`low` -> `low`, `medium` -> `medium`, and `high`/`xhigh`/`max` pass through directly. This keeps the supported Fable 5 effort levels the same for subscription-backed Claude CLI and API-key routes. `adaptive` removes configured `--effort`flags and supplies no replacement, so Claude Code resolves effective effort from its own environment, settings, and model defaults. Other CLI backends need their owning plugin to declare an equivalent argv mapper before `/think` affects the spawned CLI.
152
+
The backend maps OpenClaw `/think` levels to Claude Code's native `--effort` flag: `minimal`/`low` -> `low`, `medium` -> `medium`, and `high`/`xhigh`/`max` pass through directly. For models that allow fixed thinking budgets, it also launches Claude Code with `MAX_THINKING_TOKENS`: `off=0`, `minimal=1024`, `low=2048`, `medium=8192`, `high`/`xhigh=16384`, and `max=32768`; positive fixed budgets disable adaptive thinking. Models that require adaptive thinking omit the fixed budget and continue to use `--effort`. `adaptive` removes configured effort flags and fixed-budget environment overrides, so Claude Code resolves effective thinking from its own environment, settings, and model defaults. Other CLI backends need their owning plugin to map the selected level before `/think` affects the spawned CLI.
153
153
154
154
Before OpenClaw can use `claude-cli`, Claude Code itself must be logged in on the same host:
Copy file name to clipboardExpand all lines: docs/tools/thinking.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ title: "Thinking levels"
59
59
## Application by agent
60
60
61
61
-**Embedded OpenClaw**: the resolved level is passed to the in-process OpenClaw agent runtime.
62
-
-**Claude CLI backend**: concrete non-off levels are passed to Claude Code as `--effort` when using `claude-cli`; `adaptive` removes configured effort flags and delegates effective effort to Claude Code's environment, settings, and model defaults. See [CLI backends](/gateway/cli-backends).
62
+
-**Claude CLI backend**: concrete levels are mapped to Claude Code `--effort`; models that allow fixed budgets also receive a matching `MAX_THINKING_TOKENS` launch value. `adaptive` removes both configured effort flags and fixed-budget overrides, delegating effective thinking to Claude Code's environment, settings, and model defaults. See [CLI backends](/gateway/cli-backends).
0 commit comments