gut(middleware): remove dead thinkingLevel configuration surface (#2480)#2486
Merged
alexey-pelykh merged 1 commit intomainfrom Apr 22, 2026
Merged
gut(middleware): remove dead thinkingLevel configuration surface (#2480)#2486alexey-pelykh merged 1 commit intomainfrom
alexey-pelykh merged 1 commit intomainfrom
Conversation
CLI runtimes own reasoning depth — the thinkingLevel input pipeline has no runtime effect. Remove the remaining surface after #2463-#2471 eliminated most of it. Removals: - Delete orphan src/auto-reply/thinking.shared.ts (no importers) - Prune dead helpers in thinking.ts: ThinkingCatalogEntry, isBinaryThinkingProvider, listThinkingLevels, shadow normalizeProviderId - Drop subagents.thinking from agent-defaults types/schema and AgentEntry.subagents zod schema - Remove --thinking flag from cron add/edit + tests; strip thinking from CronPayload, normalize, store-migration, and cron jobs mergePayload/buildPayloadFromPatch - Remove thinking from gateway agent.send params, HookAgentPayload, HookAction, HookMappingResolved, server-http, server/hooks, server-node-events agent.request deep link - Remove thinking from AgentCommandOpts + thinkingOnce, agent-via-gateway, subagent-spawn _thinkingOverrideRaw / thinkingOverride, sessions_spawn tool schema - Remove thinking from protocol schemas (agent.ts, cron.ts, logs-chat.ts, sessions.ts) and ACP translator chat.send path - Remove hooks.mappings[].thinking / hooks.gmail.thinking from zod schema, types, help, labels, quality test; regenerate schema.base.generated.ts - Remove dead --thinking option + help-text example from agent CLI register; remove [--thinking] from /subagents spawn usage line; remove "thinking" from cron-tool agentTurn payload doc + JOB_KEYS - Remove dead mocks (normalizeThinkLevel, supportsXHighThinking) and dead resolvedThinkLevel param in buildStatusReply - Sweep docs: 9 files no longer teach --thinking / thinkingDefault Added: - LEGACY_CONFIG_RULES entries for agents.defaults.thinkingDefault and agents.defaults.subagents.thinking - strip-thinking-level-fields LEGACY_CONFIG_MIGRATIONS entry that strips thinkingDefault, agents.defaults.subagents.thinking, agents.list[].subagents.thinking, hooks.mappings[].thinking, and hooks.gmail.thinking so existing configs still load cleanly - 3 new tests in config-misc.test.ts covering the new migration Kept (intentional): - type === "thinking" / thinking_delta output-event rendering in middleware/runtimes, transcript truncation, ACP output blocks, TUI formatters, HTML export template - Telegram/Discord "thinking" lifecycle status emoji (different concept from thinking level) - reasoningLevel everywhere (different concept — channel-bound display behavior) remoteclaw cron add --thinking high now errors with "unknown option '--thinking'". 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 #2480. CLI runtimes own reasoning depth — the
thinkingLevelinput pipeline has no runtime effect. This PR removes the remaining surface after prior PRs (#2463, #2464, #2465, #2466, #2467, #2471, #2475, #2476) eliminated most of it.Net: 52 files changed, 185 insertions(+), 502 deletions(−). Deletes
src/auto-reply/thinking.shared.tsentirely.Removed (input pipeline — had no runtime effect)
src/auto-reply/thinking.shared.ts(no importers)thinking.ts:ThinkingCatalogEntry,isBinaryThinkingProvider,listThinkingLevels, shadownormalizeProviderIdsubagents.thinking(agent-defaults + per-agent entries),hooks.mappings[].thinking,hooks.gmail.thinking— types, zod schemas, help, labels, quality test; regeneratedschema.base.generated.ts--thinkingflag fromcron add/editandagentcommand + help-text examples;[--thinking <level>]from/subagents spawnusage linethinkingfield fromCronPayload,cron/normalize.ts,cron/normalize.test.ts,cron/service/jobs.ts(mergeCronPayload, buildPayloadFromPatch),cron/store-migration.ts,cron-cliteststhinkingfromagent.sendparams,HookAgentPayload,HookAction,HookMappingResolved,server-httphook dispatch,server/hooksagentTurn payload,server-node-eventsvoice + agent.request deep linkthinking/thinkingOncefromAgentCommandOpts,agent-via-gatewaypayload,subagent-spawn(_thinkingOverrideRaw,thinkingOverride),sessions_spawntool schema,cron-toolagentTurn payload doc + flat-paramsJOB_KEYSthinkingfromagent.ts,cron.ts,logs-chat.ts,sessions.tsthinking: readString(params._meta, [\"thinking\"])removed from chat.send path; unusedreadStringimport removednormalizeThinkLevel,supportsXHighThinkinginrun.test-harness.tsresolvedThinkLevel?: unknowninbuildStatusReply--thinking/thinkingDefault(agent CLI, cron, TUI, subagents, platforms, gateway config-reference)Added
LEGACY_CONFIG_RULESentries foragents.defaults.thinkingDefaultandagents.defaults.subagents.thinkingstrip-thinking-level-fieldsmigration inLEGACY_CONFIG_MIGRATIONS— stripsthinkingDefault,agents.defaults.subagents.thinking,agents.list[].subagents.thinking,hooks.mappings[].thinking, andhooks.gmail.thinkingso existing configs still load cleanly (.strict()zod schemas would otherwise reject unknown keys)src/config/config-misc.test.tsKept (intentional — different concepts)
type === \"thinking\"content-block processing inmiddleware/runtimes/*.ts,gateway/server-methods/chat.tstranscript truncation,gateway/server/hooks.ts,sessions-history-tool.ts,acp/translator.tsoutput block rendering,tui/tui-formatters.ts,auto-reply/reply/export-html/template.{js,css}thinkingas lifecycle state (queued → thinking → tool → done) — distinct from thinking level\"thinking\"state — UX indicatorreasoningLevel: channel-bound middleware concern (Telegram draft streaming) — unchangedCLI flag behavior after PR
remoteclaw cron add --thinking highnow errors witherror: unknown option '--thinking'(commander default). Same forcron edit,agent, and/subagents spawn --thinking.Validation
pnpm tsgo: cleanpnpm lint: 0 warnings, 0 errorspnpm format:check: all files correctly formattedpnpm test: 7011 passed, 3 pre-existing skips (no new skips); includes 3 new migration tests for thestrip-thinking-level-fieldsmigrationrg "thinkingLevel|thinkingDefault|ThinkLevel" src/: only migration/rule message text + two historical comments inacp/translator.tsreferencing prior gut(session): drop SessionEntry.thinkingLevel field + gateway schema (#2336 Area 3) #2464 removal (intentional)rg "\.thinking\b|params\.thinking" src/: only output-event rendering, emoji lifecycle state, and migration strip code — all intentionalrg "reasoningLevel" src/: 36 live hits across 22 files (intentional — separate concept, kept)Test plan
pnpm build(canvas bundle + build pipeline)pnpm test(7011 passed, 3 pre-existing skips)pnpm check(format + typecheck + lint)thinkingDefaultorsubagents.thinkingtrigger migration warning and auto-strip via new testsGenerated as part of /do-all batch 20260422-1c78, Wave 3, Track 4.