fixees
This commit is contained in:
@@ -572,6 +572,7 @@ async def _execute_tool_calls_concurrently(
|
|||||||
"""
|
"""
|
||||||
monitor = performance_monitor.get_monitor()
|
monitor = performance_monitor.get_monitor()
|
||||||
if monitor.enabled: monitor.start_component("ai_client._execute_tool_calls_concurrently")
|
if monitor.enabled: monitor.start_component("ai_client._execute_tool_calls_concurrently")
|
||||||
|
tier = get_current_tier()
|
||||||
tasks = []
|
tasks = []
|
||||||
for fc in calls:
|
for fc in calls:
|
||||||
if provider == "gemini":
|
if provider == "gemini":
|
||||||
@@ -597,7 +598,7 @@ async def _execute_tool_calls_concurrently(
|
|||||||
else:
|
else:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
tasks.append(_execute_single_tool_call_async(name, args, call_id, base_dir, pre_tool_callback, qa_callback, r_idx, patch_callback))
|
tasks.append(_execute_single_tool_call_async(name, args, call_id, base_dir, pre_tool_callback, qa_callback, r_idx, tier, patch_callback))
|
||||||
|
|
||||||
results = await asyncio.gather(*tasks)
|
results = await asyncio.gather(*tasks)
|
||||||
if monitor.enabled: monitor.end_component("ai_client._execute_tool_calls_concurrently")
|
if monitor.enabled: monitor.end_component("ai_client._execute_tool_calls_concurrently")
|
||||||
@@ -611,8 +612,11 @@ async def _execute_single_tool_call_async(
|
|||||||
pre_tool_callback: Optional[Callable[[str, str, Optional[Callable[[str], str]]], Optional[str]]],
|
pre_tool_callback: Optional[Callable[[str, str, Optional[Callable[[str], str]]], Optional[str]]],
|
||||||
qa_callback: Optional[Callable[[str], str]],
|
qa_callback: Optional[Callable[[str], str]],
|
||||||
r_idx: int,
|
r_idx: int,
|
||||||
|
tier: str | None = None,
|
||||||
patch_callback: Optional[Callable[[str, str], Optional[str]]] = None
|
patch_callback: Optional[Callable[[str, str], Optional[str]]] = None
|
||||||
) -> tuple[str, str, str, str]:
|
) -> tuple[str, str, str, str]:
|
||||||
|
if tier:
|
||||||
|
set_current_tier(tier)
|
||||||
out = ""
|
out = ""
|
||||||
tool_executed = False
|
tool_executed = False
|
||||||
events.emit("tool_execution", payload={"status": "started", "tool": name, "args": args, "round": r_idx})
|
events.emit("tool_execution", payload={"status": "started", "tool": name, "args": args, "round": r_idx})
|
||||||
|
|||||||
@@ -1141,7 +1141,6 @@ class AppController:
|
|||||||
sys.stderr.flush()
|
sys.stderr.flush()
|
||||||
self._set_status("running powershell...")
|
self._set_status("running powershell...")
|
||||||
output = shell_runner.run_powershell(script, base_dir, qa_callback=qa_callback, patch_callback=patch_callback)
|
output = shell_runner.run_powershell(script, base_dir, qa_callback=qa_callback, patch_callback=patch_callback)
|
||||||
self._append_tool_log(script, output)
|
|
||||||
self._set_status("powershell done, awaiting AI...")
|
self._set_status("powershell done, awaiting AI...")
|
||||||
return output
|
return output
|
||||||
sys.stderr.write("[DEBUG] Creating ConfirmDialog.\n")
|
sys.stderr.write("[DEBUG] Creating ConfirmDialog.\n")
|
||||||
|
|||||||
23
src/gui_2.py
23
src/gui_2.py
@@ -262,7 +262,8 @@ class App:
|
|||||||
sys.stderr.flush()
|
sys.stderr.flush()
|
||||||
self._process_pending_gui_tasks()
|
self._process_pending_gui_tasks()
|
||||||
self._process_pending_history_adds()
|
self._process_pending_history_adds()
|
||||||
self.controller._process_pending_tool_calls()
|
if self.controller._process_pending_tool_calls():
|
||||||
|
self._tool_log_dirty = True
|
||||||
self._render_track_proposal_modal()
|
self._render_track_proposal_modal()
|
||||||
self._render_patch_modal()
|
self._render_patch_modal()
|
||||||
# Auto-save (every 60s)
|
# Auto-save (every 60s)
|
||||||
@@ -310,14 +311,6 @@ class App:
|
|||||||
self._tool_log_cache = log_raw
|
self._tool_log_cache = log_raw
|
||||||
self._tool_log_dirty = False
|
self._tool_log_dirty = False
|
||||||
|
|
||||||
with self._pending_tool_calls_lock:
|
|
||||||
if self._pending_tool_calls:
|
|
||||||
if self.ui_auto_scroll_tool_calls:
|
|
||||||
self._scroll_tool_calls_to_bottom = True
|
|
||||||
self._tool_log_dirty = True
|
|
||||||
for tc in self._pending_tool_calls:
|
|
||||||
self._tool_log.append(tc)
|
|
||||||
self._pending_tool_calls.clear()
|
|
||||||
if self.show_windows.get("Context Hub", False):
|
if self.show_windows.get("Context Hub", False):
|
||||||
exp, opened = imgui.begin("Context Hub", self.show_windows["Context Hub"])
|
exp, opened = imgui.begin("Context Hub", self.show_windows["Context Hub"])
|
||||||
self.show_windows["Context Hub"] = bool(opened)
|
self.show_windows["Context Hub"] = bool(opened)
|
||||||
@@ -1883,20 +1876,22 @@ class App:
|
|||||||
|
|
||||||
imgui.table_next_column()
|
imgui.table_next_column()
|
||||||
script = entry.get("script", "")
|
script = entry.get("script", "")
|
||||||
|
res = entry.get("result", "")
|
||||||
|
combined = f"--- COMMAND ---\n{script}\n\n--- OUTPUT ---\n{res}"
|
||||||
|
|
||||||
script_preview = script.replace("\n", " ")[:150]
|
script_preview = script.replace("\n", " ")[:150]
|
||||||
if len(script) > 150: script_preview += "..."
|
if len(script) > 150: script_preview += "..."
|
||||||
if imgui.selectable(f"{script_preview}##tc_{i}", False, imgui.SelectableFlags_.span_all_columns)[0]:
|
if imgui.selectable(f"{script_preview}##tc_{i}", False, imgui.SelectableFlags_.span_all_columns)[0]:
|
||||||
self.text_viewer_title = f"Tool Script #{i+1}"
|
self.text_viewer_title = f"Tool Call #{i+1}"
|
||||||
self.text_viewer_content = script
|
self.text_viewer_content = combined
|
||||||
self.show_text_viewer = True
|
self.show_text_viewer = True
|
||||||
|
|
||||||
imgui.table_next_column()
|
imgui.table_next_column()
|
||||||
res = entry.get("result", "")
|
|
||||||
res_preview = res.replace("\n", " ")[:30]
|
res_preview = res.replace("\n", " ")[:30]
|
||||||
if len(res) > 30: res_preview += "..."
|
if len(res) > 30: res_preview += "..."
|
||||||
if imgui.button(f"View##res_{i}"):
|
if imgui.button(f"View##res_{i}"):
|
||||||
self.text_viewer_title = f"Call Output #{i+1}"
|
self.text_viewer_title = f"Tool Call #{i+1}"
|
||||||
self.text_viewer_content = res
|
self.text_viewer_content = combined
|
||||||
self.show_text_viewer = True
|
self.show_text_viewer = True
|
||||||
|
|
||||||
imgui.end_table()
|
imgui.end_table()
|
||||||
|
|||||||
Reference in New Issue
Block a user