fix: exclude system prompt from routing classification#14
Merged
evansantos merged 1 commit intomainfrom Feb 19, 2026
Merged
Conversation
System prompt is static context (AGENTS.md, SOUL.md, USER.md, etc.) that inflates text length and triggers 'lengthy-content' signal on every request. Only classify user messages + recent history for accurate intent detection. Before: 'oi' → reasoning (lengthy-content from 15k+ system prompt) After: 'oi' → simple (only user message evaluated)
There was a problem hiding this comment.
Score: Excellent ✅
This PR fixes a logical error in the routing classification by excluding the system prompt from the messages used for classification. This ensures that the classification accurately reflects user intent rather than the static context of the system prompt, preventing misclassification as 'reasoning/lengthy-content' due to large system prompts.
1 finding posted as inline comments below.
Review completed in 33s | Basic Plan | Gemini 2.5 Flash
Comment on lines
349
to
350
| const classificationMessages: Message[] = []; | ||
|
|
There was a problem hiding this comment.
ℹ️ Info
The blank line at L350 is unnecessary and can be removed to improve code readability and adhere to typical code formatting standards.
Fix: Remove the blank line at L350.
Suggested change
| const classificationMessages: Message[] = []; | |
| const classificationMessages: Message[] = []; |
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.
Problem
Every message — even a simple "oi" — was being classified as
reasoningtier withlengthy-contentsignal. The routing classifier was including the system prompt (~15k+ chars of AGENTS.md, SOUL.md, USER.md, TOOLS.md) in the classification input, which always triggered thetext.length > 1000threshold.Fix
Exclude system prompt from classification messages. The system prompt is static context that doesn't indicate request complexity — only user messages and recent history should determine routing tier.
Before
After
Files Changed
src/index.ts— removedsystemPromptfrom classification messages🐕 GitSniff Summary
What this PR does
This change enhances the accuracy of the SlimClaw plugin's routing classification by preventing the system prompt from influencing the classification of user requests. By excluding the static system prompt, the classifier can more accurately determine the complexity and intent of actual user messages, leading to more appropriate model routing decisions and token optimization. This correction ensures that small, simple user prompts are correctly identified as such, rather than being misclassified due to a lengthy system prompt.
Key Changes
classificationMessagesarray inllm_inputhook.reasoningtier withlengthy-contentsignal due to large system prompts.Review Score: Excellent 🟢
Tip
No major issues found. Safe to merge.
🐕 Reviewed by GitSniff