2.3 KiB
2.3 KiB
Implementation Plan: Enhanced Context Control & Cache Awareness (enhanced_context_control_20260307)
Reference: Spec | Architecture Guide
Phase 1: Data Model & Project Configuration
Focus: Update the underlying structures to support per-file flags.
- Task 1.1: Update
FileItemdataclass/model to includeauto_aggregateandforce_fullflags. - Task 1.2: Modify
project_manager.pyto parse and serialize these new flags inmanual_slop.tomlorproject.toml. Ensure backward compatibility with existing simple file lists.
Phase 2: Context Builder Updates
Focus: Make the context aggregation logic respect the new flags.
- Task 2.1: Update
aggregate.pyto filter out files whereauto_aggregateis False. - Task 2.2: Modify skeleton generation logic in
aggregate.pyto send full content whenforce_fullis True. - Task 2.3: Add support for manual 'Context' role injections to bypass
auto_aggregaterestrictions for specific turns.
Phase 3: Gemini Cache Tracking
Focus: Track and expose API cache state.
- Task 3.1: Modify
ai_client.py's Gemini cache logic to record which file paths/hashes are currently in the active server-side cache. - Task 3.2: Create an event payload (e.g., via
comms_log_callbackor a dedicated queue event) to push the active cache state to the GUI.
Phase 4: UI Refactoring
Focus: Update the Files & Media panel and event handlers.
- Task 4.1: Refactor the Files & Media panel in
gui_2.pyfrom a list to an ImGui table displaying the files, their checkboxes (Auto-Aggregate, Force Full), and the Cached indicator dot. - Task 4.2: Implement handlers in
_process_pending_gui_tasksto receive cache state updates and render the indicator dots. - Task 4.3: Wire the table checkboxes to update the in-memory models and trigger project saves (
_save_active_project()).
Phase 5: Testing & Verification
Focus: Ensure stability and adherence to the architecture.
- Task 5.1: Write unit tests verifying configuration parsing, flag-respecting context aggregation, and cache tracking.
- Task 5.2: Perform a manual UI walkthrough to confirm the table displays correctly, checkboxes toggle state, and cache indicators light up when the Gemini API responds.