Private
Public Access
0
0

progress on context composition

This commit is contained in:
2026-05-17 06:55:00 -04:00
parent 22f3b9f33a
commit c1487d32bb
3 changed files with 72 additions and 12 deletions
+21 -1
View File
@@ -2933,9 +2933,25 @@ class AppController:
self.ui_file_paths = [f.path for f in preset.files]
self.screenshots = list(preset.screenshots)
self._save_active_project()
# We need to tell gui_2 to populate the full FileItem state from the preset,
# which it does in _handle_refresh_from_project. But we also need to pass the detailed properties.
# We will let the project_manager handle merging in the preset files via configuration next turn.
# Wait, project manager doesn't load preset files into self.files automatically here.
# Let's write the preset files into self.project["files"] directly.
import copy
self.project.setdefault("files", {})["paths"] = [
{
"path": f.path,
"view_mode": f.view_mode,
"custom_slices": copy.deepcopy(f.custom_slices),
"ast_mask": copy.deepcopy(f.ast_mask),
"ast_signatures": getattr(f, "ast_signatures", False),
"ast_definitions": getattr(f, "ast_definitions", False)
} for f in preset.files
]
self._save_active_project()
return preset
def _cb_load_track(self, track_id: str) -> None:
"""
[C: src/gui_2.py:App._render_mma_track_browser]
@@ -3445,6 +3461,10 @@ class AppController:
flat = project_manager.flat_config(self.project, self.active_discussion, track_id=track_id)
flat.setdefault("files", {})["paths"] = self.context_files
# Configure MCP so that aggregate.py can fetch skeletons for external files (e.g. gencpp)
file_dicts = [f.to_dict() if hasattr(f, 'to_dict') else {"path": str(f)} for f in self.context_files]
mcp_client.configure(file_dicts, [self.active_project_root] if self.active_project_root else None)
persona = self.personas.get(self.ui_active_persona)
strategy = persona.aggregation_strategy if persona else "auto"