feat: replace janitor LLM with direct tool-based pruning#61
Merged
feat: replace janitor LLM with direct tool-based pruning#61
Conversation
The session AI now decides what to prune via numeric IDs instead of a separate janitor LLM call. - Add numeric ID mapping system for simple tool references (1, 2, 3...) - Inject <prunable-tools> list at end of conversation - Prune tool accepts array of IDs to remove - Remove janitor LLM, model-selector, and pruning prompt
…ounts - Add clearAllMappings() to id-mapping.ts for resetting module-level state - Detect session changes in hooks.ts and clear ID mappings + tool cache - Make API format handlers mutually exclusive (else if) to prevent double-processing - Exclude protected tools from 'total' count in replacement logs - Pass protectedTools set to trackNewToolResults functions for nudge frequency
…nd fix tool ID case handling
- Restore model-selector.ts for LLM model selection with provider fallback - Restore runLlmAnalysis() and replacePrunedToolOutputs() in janitor.ts - Restore buildAnalysisPrompt() and minimizeMessages() in prompt.ts - Restore pruning.txt prompt template - Restore ModelInfo interface and state.model map for model caching - Add model caching back to hooks.ts chat.params handler - Remove dead code: getNumericIdsForActual, getNumericId, getAllMappings, hasMapping, getNextId
Tarquinen
added a commit
that referenced
this pull request
Dec 3, 2025
Restore the helpful guidance that was shortened in PR #61, telling subagents to continue with their work or provide final summary.
Tarquinen
added a commit
that referenced
this pull request
Dec 3, 2025
Restore the helpful guidance that was shortened in PR #61, telling subagents to continue with their work or provide final summary.
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
Session AI now decides what to prune directly via numeric IDs, eliminating the separate janitor LLM call.
Changes
<prunable-tools>list injected at end of conversation