This commit is contained in:
2026-02-21 16:51:00 -05:00
parent ee1ee1c77e
commit 330c8604c9
5 changed files with 438 additions and 141 deletions

14
gui.py
View File

@@ -303,6 +303,7 @@ class App:
self.ai_response = ""
self.last_md = ""
self.last_md_path: Path | None = None
self.last_file_items: list = []
self.send_thread: threading.Thread | None = None
self.models_thread: threading.Thread | None = None
@@ -349,7 +350,7 @@ class App:
_render_comms_entry("comms_scroll", entry, idx)
def _rebuild_comms_log(self):
"""Full redraw from ai_client.get_comms_log() used after clear/reset."""
"""Full redraw from ai_client.get_comms_log() - used after clear/reset."""
if not dpg.does_item_exist("comms_scroll"):
return
dpg.delete_item("comms_scroll", children_only=True)
@@ -425,7 +426,7 @@ class App:
"model": self.current_model,
}
def _do_generate(self) -> tuple[str, Path]:
def _do_generate(self) -> tuple[str, Path, list]:
self._flush_to_config()
save_config(self.config)
return aggregate.run(self.config)
@@ -576,7 +577,7 @@ class App:
def cb_md_only(self):
try:
md, path = self._do_generate()
md, path, _file_items = self._do_generate()
self.last_md = md
self.last_md_path = path
self._update_status(f"md written: {path.name}")
@@ -601,9 +602,10 @@ class App:
if self.send_thread and self.send_thread.is_alive():
return
try:
md, path = self._do_generate()
md, path, file_items = self._do_generate()
self.last_md = md
self.last_md_path = path
self.last_file_items = file_items
except Exception as e:
self._update_status(f"generate error: {e}")
return
@@ -612,9 +614,11 @@ class App:
user_msg = dpg.get_value("ai_input")
base_dir = dpg.get_value("files_base_dir")
file_items_snap = self.last_file_items
def do_send():
try:
response = ai_client.send(self.last_md, user_msg, base_dir)
response = ai_client.send(self.last_md, user_msg, base_dir, file_items_snap)
self._update_response(response)
self._update_status("done")
except Exception as e: