Conversation
…king Accept "off" in classifierReasoningLevel so the classifier can run without thinking on models that support it (per pi-ai's thinkingLevelMap, e.g. DeepSeek V4.1 Flash and GLM-5.2). The runtime already had a complete effectiveLevel === "off" path in createClassifierCompletionPlan(); it was unreachable via config because validation excluded the value. Models that cannot disable thinking keep the existing clamping semantics: clampThinkingLevel resolves "off" to the nearest supported level (e.g. minimal for GLM-5.3 / GPT-5.6 Luna). Verified end-to-end against Fireworks deepseek-v4p1-flash: classifier requests send no reasoning option, pi-ai emits thinking disabled on the wire, responses contain zero reasoning tokens, and decisions parse on the first attempt.
bsamek
marked this pull request as ready for review
September 21, 2026 17:54
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.
classifierReasoningLevel: "off"is rejected by validation, but the runtime already supports itSummary
AutoModeSettings.classifierReasoningLevelonly acceptslow | medium | high | xhigh | max, so there is no way to ask the classifier to disable thinking. Meanwhile,createClassifierCompletionPlan()inclassifier.tsalready has a completeeffectiveLevel === "off"execution path (it selects the simple completion and omits the reasoning option) — it's just unreachable via config, because the config validator excludes"off".Why "off" matters
Several classifier-worthy models support a true non-thinking mode via Pi AI's
thinkingLevelMap:thinkingLevelMap.offfireworks/.../deepseek-v4p1-flash"none"thinking: { type: "disabled" }fireworks/.../glm-5p2"none"reasoning_effort: "none"fireworks/.../glm-5p3nullgithub-copilot/gpt-5.6-lunanullminimal(→loweffort)With no reasoning preference (the current behavior when
classifierReasoningLevelis absent), these "off-capable" models still run their server-default reasoning on every classification. Requesting"off"explicitly makes the fast stage genuinely non-thinking — a large latency win for a gate that runs on every non-read-only tool call.Proposed change
Accept
"off"inClassifierReasoningLeveland in config validation. The existing clamping semantics already handle models that cannot disable thinking:clampThinkingLevel(model, "off")walks up to the nearest supported level (e.g.minimalfor GLM-5.3 / GPT-5.6 Luna), so behavior degrades gracefully instead of failing.Full diff attached as
0001-allow-classifierReasoningLevel-off.patch. It touches:extensions/auto-mode/types.ts— add"off"toClassifierReasoningLevel; narrowEffectiveClassifierReasoningLevelso the union shape is unchanged (allExclude<EffectiveClassifierReasoningLevel, "off">sites are unaffected).extensions/auto-mode/config.ts— add"off"toCLASSIFIER_REASONING_LEVELS; update the diagnostic message.docs/configuration.md— document"off"and the clamping behavior.Verification
Tested locally against v1.16.0 with Pi AI's real model metadata:
isClassifierReasoningLevel("off") === true; garbage values still rejected.createClassifierCompletionPlan(deepseek-v4p1-flash, "off", …)→{ effectiveLevel: "off" }, simple-completion path, no reasoning option sent → pi-ai emitsthinking: { type: "disabled" }on the wire.createClassifierCompletionPlan(glm-5p3, "off", …)→ clamps tominimal(same asclampThinkingLevelsemantics used for other levels).classifierModel: fireworks/accounts/fireworks/models/deepseek-v4p1-flashandclassifierReasoningLevel: "off"; classifier decisions (fast + detailed stages) round-tripped successfully with no reasoning content in responses.Suggested test