gut(session): drop SessionEntry.thinkingLevel field + gateway schema — Area 3 of #2336#2476
Merged
alexey-pelykh merged 1 commit intomainfrom Apr 22, 2026
Merged
Conversation
…— Area 3 of #2336 (#2464) Completes Area 3 of the vestigial thinking-level sweep. Removes the SessionEntry.thinkingLevel field, its gateway protocol schema entry, the `agents.defaults.thinkingDefault` config entry, and every consumer across gateway, auto-reply, agents, status/TUI, ACP translator, HTML export, extensions, and tests. RemoteClaw does not control reasoning depth — CLI runtimes (Claude, Gemini, Codex, OpenCode) own it. Reader-before-writer ordering satisfied: - #2471 (PR #2467) removed the Web UI reader first — safe to stop sending. - Native apps still reference thinkingLevel as display-only; they now see the field absent and degrade gracefully per the umbrella's audit. ACP bridge surgery: - thought_level mode presentation removed (modes = empty). - setSessionMode is a silent no-op. - thought_level config option removed from setSessionConfigOption. - chat.send _meta fallback simplified to single "thinking" key. Test surface updated in 13 test files. Where tests used thinkingLevel as a generic test field for store-update behavior, swapped to verboseLevel (still schema-valid). Where tests specifically exercised the gutted feature, rewrote (translator.set-session-mode.test.ts) or removed the stale cases. Schema regenerated via scripts/generate-base-config-schema.ts. Docs config baseline regenerated. Docs updated to drop stale references. Fork-boundary-mock baseline 133→132 (decrease locked in). AC verification: - `git grep "thinkingLevel" src/` → 2 hits, both in migration comments - `pnpm check` → PASS - All fork-integrity gates → PASS Closes #2464. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Closes #2464 / Area 3 of umbrella #2336.
Removes
SessionEntry.thinkingLeveland the gateway protocol schema field, plus every consumer across gateway, auto-reply, agents, status/TUI, ACP translator, HTML export, Mattermost extension, and tests. RemoteClaw does not control reasoning depth — CLI runtimes own it.Also removes
agents.defaults.thinkingDefault(dead after/thinkdirective was gutted in #2466).Why this is safe
Reader-before-writer ordering:
chat.history.thinkingLevelandSessionsPatchResult.entry.thinkingLevel. Web UI stopped reading before this PR stops sending.thinkingLevelas display-only state-drivers per gut(ui): remove dead thinkingLevel display plumbing (#2336 Area 7) #2471's audit. After this PR, the field is absent from gateway responses — apps see it as undefined and degrade gracefully. Full native-app rewrite deferred per umbrella guidance.sessions.patch({thinkingLevel})now fails schema validation (additionalProperties: false). ACP bridge's ownsetSessionModeandsetSessionConfigOption("thought_level", ...)flows were gutted in the same PR.Changes
Core type + schema (10 files)
src/config/sessions/types.tsthinkingLevel?: stringfromSessionEntrysrc/gateway/protocol/schema/sessions.tsthinkingLevelfromSessionsPatchParamsSchemasrc/config/types.agent-defaults.tsthinkingDefault+/thinkcommentsrc/config/zod-schema.agent-defaults.tsthinkingDefaultentrysrc/config/schema.base.generated.tssrc/config/types.messages.ts{thinkingLevel}/{think}from responsePrefix template docstringsrc/gateway/session-utils.types.tsGatewaySessionRowsrc/gateway/session-utils.tssrc/gateway/server-node-events.tssrc/gateway/server-methods/{chat,sessions,agent}.tsACP bridge surgery (
src/acp/translator.ts)Thought-level mode presentation gutted entirely:
thinkingLevelremoved fromGatewaySessionPresentationRowPick andGatewaySessionRowunionformatThinkingLevelName,buildThinkingModeDescription, and thexhighcase informatConfigValueNameremoved (all dead after mode removal)buildSessionPresentationreturnsmodes: { currentModeId: "", availableModes: [] }— ACP bridge exposes no modessetSessionModeis a silent no-op (returns{}, never calls gateway)setSessionConfigOption("thought_level", ...)case removed — now rejects with "does not support"chat.send_meta simplified toreadString(params._meta, ["thinking"])(single key, no thinkingLevel fallback)getGatewaySessionRowno longer reads thinkingLevellistThinkingLevelsimport dropped (no remaining callers in translator)Auto-reply + agents + status + TUI (9 files)
src/auto-reply/reply/session.tspersistedThinkinglocal + carry-over (verbose/reasoning/tts/model-override preserved)src/auto-reply/reply/response-prefix-template.tsthinkingLevelcontext field +{thinkingLevel}/{think}interpolationsrc/auto-reply/reply/export-html/template.jsthinking_level_changeentry type display (CLIs no longer emit)src/agents/tools/{sessions-helpers,sessions-list-tool}.tssrc/agents/subagent-spawn.tssessions.patch({thinkingLevel})call (schema would reject anyway)src/commands/status.{summary,types}.tssrc/tui/{tui,tui-types,tui-session-actions,gateway-chat}.tsExtensions + docs
extensions/mattermost/src/mattermost/monitor-helpers.ts— drop fromResponsePrefixContextdocs/concepts/session-tool.md,docs/reference/session-management-compaction.md,docs/gateway/configuration-reference.md,docs/gateway/configuration-examples.md— drop stale referencesdocs/.generated/config-baseline.json— regeneratedTests (13 files)
thinkingLevelas a generic field for store-update behavior, swapped toverboseLevel(still schema-valid):src/config/sessions.test.ts,src/gateway/server.config-patch.test.ts,src/gateway/server.sessions.gateway-server-sessions-a.test.tssrc/acp/translator.set-session-mode.test.ts— rewritten for no-op contractsrc/acp/translator.session-rate-limit.test.ts— thought-level mode tests replaced with no-op assertionssrc/commands/agent.test.ts—thinkingDefault//think-related tests removedFork baseline
.fork-boundary-mock-baseline: 133 → 132 (decrease locked in)Verification
git grep "thinkingLevel"insrc/→ 2 hits, both in migration-only comments (AC-allowed per issue body)git grep "thinkingDefault"insrc/→ 0 hitspnpm check→ PASS (format + tsgo + lint + 2 project-specific linters)Test plan
pnpm checklocallyLIVE=1 pnpm test:liveattempted — middleware smoke tests require local CLI credentials (pre-existing, unrelated to thinkingLevel)Context
🤖 Generated with Claude Code