feat(ui): ✨ implement AI assistant system with full context awareness and tool execution#36
Draft
feat(ui): ✨ implement AI assistant system with full context awareness and tool execution#36
Conversation
… and tool execution This commit introduces a comprehensive AI assistant system for the Model Filter GUI, providing contextual help and automated configuration capabilities. Core Components: - AIAssistantCore: Orchestrates conversation sessions, tool execution, and checkpoint management - LLMBridge: Bridges async RotatingClient with synchronous GUI thread using threading coordination - CheckpointManager: Hybrid snapshot/delta system for undo capability with crash recovery - ToolExecutor: Validates and executes window-specific tools with automatic retry logic - WindowContextAdapter: Abstract interface for window integration with context extraction UI Features: - Pop-out chat window with streaming responses and collapsible thinking sections - Model selector with provider grouping and reasoning effort configuration - Checkpoint dropdown for rollback to previous states - Virtual message list with user/AI messages, tool execution results, and error handling - Multi-line input with keyboard shortcuts (Ctrl+Enter to send, Escape to cancel) Model Filter Integration: - 15 specialized tools for rule management (add/remove ignore/whitelist patterns) - Query tools for pattern preview and model status explanation - State management tools (save/discard changes, provider switching) - Full context extraction with change tracking and diff detection - Window locking during AI execution to prevent race conditions Technical Implementation: - Async/sync coordination using threading.Thread + asyncio.run() - Streaming chunk processing with thinking/content separation - Automatic checkpoint creation before write operations - Silent retry logic (up to 4 attempts) for invalid tool calls - Temp file persistence for checkpoint crash recovery - Grid-based responsive layout with dynamic resizing The assistant has complete visibility into window state, can execute multiple tools in sequence, maintains conversation history, and provides verbose feedback on all operations. Changes are non-destructive with full rollback capability.
This commit restructures the AI chat window layout to create a more space-efficient interface: - Moved Send and New Session buttons from bottom status bar to right side of input area, stacked vertically - Reduced button sizes (90x26px) and input area min-height (80→55px) for compactness - Changed checkpoint dropdown button to icon-only (↩️) to save horizontal space (120→40px width) - Refactored thinking section from CTkTextbox to CTkLabel to eliminate unnecessary scrollbar - Added mousewheel event capture to thinking section to prevent scroll propagation when expanded - Updated layout to use grid for input/button positioning with proper weight distribution The changes maintain all functionality while significantly reducing vertical space usage and improving visual density of the interface.
Adjust top and bottom padding of status frame from (4, 8) to (0, 4) to achieve a more compact visual appearance, consistent with recent layout optimization efforts.
…interactions
Implement a detailed logging infrastructure to track and debug AI assistant requests, responses, and tool execution flow.
- Add `AssistantLogger` class to capture complete conversation turns including request parameters, streaming chunks, tool calls, tool execution results, and final responses
- Create structured log directories per session with timestamped turn folders containing JSON and JSONL files for analysis
- Integrate logging into `LLMBridge` to automatically track all streaming events and tool call validation
- Add tool call validation in bridge to skip empty tool names and auto-generate missing IDs
- Enhance `AIAssistantCore` with debug logging for message flow, tool execution, and agentic loop continuation
- Fix assistant message formatting to include null content when tool_calls are present for provider compatibility
- Export `AssistantLogger` through package `__all__` for external access
The logging system writes comprehensive diagnostics to `logs/assistant_logs/{session_id}/{timestamp}_{turn_id}/` including request.json, streaming_chunks.jsonl, tool_calls.json, tool_results.jsonl, final_response.json, and metadata.json files.
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.
Yes, i have committed a great sin.
This commit introduces a comprehensive AI assistant system for the Model Filter GUI, providing contextual help and automated configuration capabilities.
Core Components:
UI Features:
Model Filter Integration:
Technical Implementation:
The assistant has complete visibility into window state, can execute multiple tools in sequence, maintains conversation history, and provides verbose feedback on all operations. Changes are non-destructive with full rollback capability.
Important
Introduces a comprehensive AI assistant system for the Model Filter GUI, enhancing user interaction with contextual help and automated configuration capabilities.
AIAssistantCore,LLMBridge,CheckpointManager,ToolExecutor, andWindowContextAdapterfor managing AI interactions and tool executions.ai_assistantdirectory with core logic, UI components, and adapters.AIChatWindowfor pop-out chat with streaming responses and tool execution results.model_filter.py.model_filter_gui.pyand binds it to open the assistant window.README.mdwith relevant information.This description was created by
for 1371a73. You can customize this summary. It will automatically update as commits are pushed.