fix: improve context debug command with error handling and performance#184
Merged
laynepenney merged 7 commits intomainfrom Jan 26, 2026
Merged
fix: improve context debug command with error handling and performance#184laynepenney merged 7 commits intomainfrom
laynepenney merged 7 commits intomainfrom
Conversation
- Remove duplicate paragraph in Codi's Capabilities section - Remove duplicate non-interactive mode examples from Quick Reference - Fix chaotic feature numbering in Lower Priority section (reordered to 12-31) - Remove redundant security vulnerability paragraph Wingman: Codi <codi@layne.pro>
- Renumbered features from chaotic sequence to clean 1-24 numbering - Removed gap between features 13 and 21 by integrating implemented features - Fixed duplicate entries by properly organizing Lower Priority section - Updated Implementation Priority Recommendation to match feature order - No content removed - only organizational improvements Wingman: Codi <codi@layne.pro>
Adds a new /compact debug subcommand that provides detailed information about the current context window contents including: - Token counts by category (messages, system prompt, tool definitions) - Message breakdown by role (user, assistant, tool results) - Current limits and budget information - Compression status and statistics - Working set file count - Message previews with content length information This helps developers understand what's consuming context space and troubleshoot context-related issues. Wingman: Codi <codi@layne.pro>
- Add error handling around debug subcommand with proper error messages - Rename 'messages' property to 'messagePreviews' for clarity - Add validation for null/undefined messages array - Optimize contentLength calculation for complex content - Fix error message to include 'memory' subcommand Wingman: Codi <codi@layne.pro>
- Add try-catch wrapper for proper error handling - Rename 'messages' property to 'messagePreviews' for clarity - Add input validation for null/undefined messages array - Optimize contentLength calculation for complex content - Update error message to include 'memory' subcommand Wingman: Codi <codi@layne.pro>
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.
This PR improves the context debug command with critical error handling and performance optimizations.
Fixes Applied
Error Handling
Code Quality
Performance
Documentation
Testing
Risk Assessment
Wingman: Codi codi@layne.pro