Context
Follow-up to #2334 / #2335. The core bug (TypeError: modelState.resolveDefaultThinkingLevel is not a function) and the adjacent dead plumbing (modelState threading, createModelSelectionState, resolveDefaultThinkingLevel, XHigh gating, stub file, fabricated test shapes) were swept in #2335. This issue tracks the remaining vestigial thinking-level / model-selection surface that was deliberately deferred from that PR to keep the first pass reviewable.
Per the broader framing: RemoteClaw does NOT control thinking levels or model selection — the CLI runtimes (Claude, Gemini, Codex, OpenCode) own those decisions. Anything in this fork that resolves, gates, or stores thinking-level state is vestigial from upstream OpenClaw.
Scope
1. /think directive end-to-end removal
2. thinking.ts helper deletion
Once /think parsing is gone, these helpers have no callers:
3. Session state thinkingLevel field
4. thinkLevel dead passthrough plumbing
These carry thinkLevel through the reply pipeline but nothing consumes it now that XHigh gating and the agent-runner-execution thinkLevel: undefined always-override are the only sinks:
5. Directive handling model-state internals
handleDirectiveOnly, applyInlineDirectivesFastLane, and their params carry aliasIndex, allowedModelKeys, allowedModelCatalog, resetModelOverride, defaultProvider, defaultModel, initialModelLabel, formatModelSwitchEvent. After #2335 these are always empty/trivial because createModelSelectionState is gone, but the whole directive-handling model-switching path is still wired:
6. Docs
7. Display-layer audit
Native apps and the web UI still reference thinkingLevel in chat views. Needs per-file classification:
For each: is the reference pass-through display (rendering what the CLI reports — KEEP) or state driver (mutating/sending — REMOVE)? Do NOT touch native apps without confirming — they compile to distinct binaries with their own release pipelines.
8. Test-layer hardening
Acceptance Criteria
Size estimate
~30 files, ~400-600 line deletions, plus per-file judgment on native apps. Larger and more cross-cutting than #2335 — should probably be split into sub-PRs by area (e.g., "directive removal", "thinking.ts helpers", "session state", "docs", "display audit", "test-layer hardening") for reviewability.
Related
Context
Follow-up to #2334 / #2335. The core bug (
TypeError: modelState.resolveDefaultThinkingLevel is not a function) and the adjacent dead plumbing (modelStatethreading,createModelSelectionState,resolveDefaultThinkingLevel, XHigh gating, stub file, fabricated test shapes) were swept in #2335. This issue tracks the remaining vestigial thinking-level / model-selection surface that was deliberately deferred from that PR to keep the first pass reviewable.Per the broader framing: RemoteClaw does NOT control thinking levels or model selection — the CLI runtimes (Claude, Gemini, Codex, OpenCode) own those decisions. Anything in this fork that resolves, gates, or stores thinking-level state is vestigial from upstream OpenClaw.
Scope
1.
/thinkdirective end-to-end removalsrc/auto-reply/reply/directive-handling.parse.ts— delete/thinkparsing andhasThinkDirective/thinkLevelfields fromInlineDirectivessrc/tui/tui-command-handlers.ts:316— delete/thinkhelp text and slash handlersrc/gateway/server-methods/chat.ts:976— deleteinjectThinking-based/thinkinjection intocommandBodysrc/auto-reply/reply.triggers.trigger-handling.targets-active-session-native-stop.e2e.test.ts— update or delete the e2e test that asserts/think:highgets stripped2.
thinking.tshelper deletionOnce
/thinkparsing is gone, these helpers have no callers:src/auto-reply/thinking.ts— deletenormalizeThinkLevel,supportsXHighThinking,formatXHighModelHint, and (if unused)ThinkLeveltypesrc/commands/agent/session.ts:6,155— removenormalizeThinkLevelimport + call onsessionEntry.thinkingLevelsrc/cron/isolated-agent/run.test-harness.ts:132,134— removenormalizeThinkLevel/supportsXHighThinkingvi.fn mocks3. Session state
thinkingLevelfieldsrc/config/sessions/types.ts— deletethinkingLevelfromSessionEntrysrc/gateway/protocol/schema/sessions.ts— delete the gateway schema fieldsrc/config/types.agent-defaults.ts:177— delete the/thinkcomment and any default fieldthinkingLevelvalues. Since the field is optional and unread, existing sessions will load fine (extra fields ignored) and save without it.4.
thinkLeveldead passthrough plumbingThese carry
thinkLevelthrough the reply pipeline but nothing consumes it now that XHigh gating and the agent-runner-executionthinkLevel: undefinedalways-override are the only sinks:src/auto-reply/types.ts:16— removeModelSelectedContext.thinkLevel(response-prefix template interpolation)src/auto-reply/reply/queue/types.ts:72— removethinkLevel?: unknownfromFollowupRun.runsrc/auto-reply/reply/followup-runner.ts:203— remove passthroughsrc/auto-reply/reply/agent-runner-utils.ts:183— remove frombuildEmbeddedRunBaseParamssrc/auto-reply/reply/agent-runner-execution.ts:231— remove the always-undefined passsrc/auto-reply/reply/get-reply-run.ts:511— removethinkLevel: resolvedThinkLevelfromfollowupRun.runsrc/auto-reply/reply/get-reply.ts(and callers) — removeresolvedThinkLevelplumbing entirely once there is no downstream consumeragent-runner.runreplyagent.e2e.test.ts,agent-runner.media-paths.test.ts,commands/agent.test.ts— removethinkLevelassertions5. Directive handling model-state internals
handleDirectiveOnly,applyInlineDirectivesFastLane, and their params carryaliasIndex,allowedModelKeys,allowedModelCatalog,resetModelOverride,defaultProvider,defaultModel,initialModelLabel,formatModelSwitchEvent. After #2335 these are always empty/trivial becausecreateModelSelectionStateis gone, but the whole directive-handling model-switching path is still wired:src/auto-reply/reply/directive-handling.params.ts— delete the model-state fields fromHandleDirectiveOnlyCoreParamssrc/auto-reply/reply/directive-handling.impl.ts— delete model-switching logic and unused paramssrc/auto-reply/reply/directive-handling.fast-lane.ts— delete the destructures andhandleDirectiveOnlycall wiringsrc/auto-reply/reply/get-reply-directives-apply.ts— delete the inline empty-defaultdirectiveModelState(introduced as a compat shim in gut(auto-reply): remove dead thinking-level resolution plumbing (#2334) #2335) and the remainingaliasIndex/initialModelLabel/formatModelSwitchEventthreading6. Docs
docs/tools/slash-commands.md— remove/thinkentries (lines 17, 104, 122)docs/concepts/context.md:139— remove/thinkfrom directive listdocs/web/tui.md:94— remove/thinkTUI documentationdocs/channels/group-messages.md:18,70— remove/think highexamples (use/verbose oninstead)7. Display-layer audit
Native apps and the web UI still reference
thinkingLevelin chat views. Needs per-file classification:apps/android/app/src/main/java/org/remoteclaw/app/chat/ChatModels.kt,ChatController.ktapps/android/app/src/main/java/org/remoteclaw/android/chat/ChatController.kt,NodeRuntime.ktapps/shared/RemoteClawKit/Sources/RemoteClawChatUI/ChatViewModel.swift,ChatSessions.swift,ChatComposer.swiftapps/shared/RemoteClawKit/Tests/RemoteClawKitTests/ChatViewModelTests.swiftui/src/ui/types.ts,app-render.ts,views/chat.ts,controllers/chat.tsFor each: is the reference pass-through display (rendering what the CLI reports — KEEP) or state driver (mutating/sending — REMOVE)? Do NOT touch native apps without confirming — they compile to distinct binaries with their own release pipelines.
8. Test-layer hardening
runPreparedReplymock insrc/auto-reply/reply/get-reply.test-mocks.ts:39-40— it currently replaces the real function withvi.fn(async () => undefined), preventing any integration test from exercising theresolveReplyDirectives→runPreparedReplyboundary (this is one of the five shields that hid gut(auto-reply): remove dead thinking-level and model-selection plumbing — TypeError on first-turn messages #2334 from CI)runPreparedReplywithresolvedThinkLevel: undefinedthrough the realresolveReplyDirectiveschain (no fabricated fixtures)as never/as anyin test arrangement code — every fabricated shape is a pending production crashAcceptance Criteria
grep -rn "/think\b\|hasThinkDirective\|thinkLevel\|thinkingLevel\|supportsXHighThinking\|normalizeThinkLevel\|formatXHighModelHint" src/ extensions/ docs/returns only legitimate pass-through display references (if any)pnpm checkgreenpnpm testgreenLIVE=1 pnpm test:livegreen on at least one channel smoke test for first-turn message pathrunPreparedReplymock removed; integration test exercises real chain/thinkremoved from all user-facing docsSize estimate
~30 files, ~400-600 line deletions, plus per-file judgment on native apps. Larger and more cross-cutting than #2335 — should probably be split into sub-PRs by area (e.g., "directive removal", "thinking.ts helpers", "session state", "docs", "display audit", "test-layer hardening") for reviewability.
Related