fixees
This commit is contained in:
@@ -572,6 +572,7 @@ async def _execute_tool_calls_concurrently(
|
||||
"""
|
||||
monitor = performance_monitor.get_monitor()
|
||||
if monitor.enabled: monitor.start_component("ai_client._execute_tool_calls_concurrently")
|
||||
tier = get_current_tier()
|
||||
tasks = []
|
||||
for fc in calls:
|
||||
if provider == "gemini":
|
||||
@@ -597,7 +598,7 @@ async def _execute_tool_calls_concurrently(
|
||||
else:
|
||||
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)
|
||||
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]]],
|
||||
qa_callback: Optional[Callable[[str], str]],
|
||||
r_idx: int,
|
||||
tier: str | None = None,
|
||||
patch_callback: Optional[Callable[[str, str], Optional[str]]] = None
|
||||
) -> tuple[str, str, str, str]:
|
||||
if tier:
|
||||
set_current_tier(tier)
|
||||
out = ""
|
||||
tool_executed = False
|
||||
events.emit("tool_execution", payload={"status": "started", "tool": name, "args": args, "round": r_idx})
|
||||
|
||||
@@ -1141,7 +1141,6 @@ class AppController:
|
||||
sys.stderr.flush()
|
||||
self._set_status("running powershell...")
|
||||
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...")
|
||||
return output
|
||||
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()
|
||||
self._process_pending_gui_tasks()
|
||||
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_patch_modal()
|
||||
# Auto-save (every 60s)
|
||||
@@ -310,14 +311,6 @@ class App:
|
||||
self._tool_log_cache = log_raw
|
||||
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):
|
||||
exp, opened = imgui.begin("Context Hub", self.show_windows["Context Hub"])
|
||||
self.show_windows["Context Hub"] = bool(opened)
|
||||
@@ -1883,20 +1876,22 @@ class App:
|
||||
|
||||
imgui.table_next_column()
|
||||
script = entry.get("script", "")
|
||||
res = entry.get("result", "")
|
||||
combined = f"--- COMMAND ---\n{script}\n\n--- OUTPUT ---\n{res}"
|
||||
|
||||
script_preview = script.replace("\n", " ")[:150]
|
||||
if len(script) > 150: script_preview += "..."
|
||||
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_content = script
|
||||
self.text_viewer_title = f"Tool Call #{i+1}"
|
||||
self.text_viewer_content = combined
|
||||
self.show_text_viewer = True
|
||||
|
||||
imgui.table_next_column()
|
||||
res = entry.get("result", "")
|
||||
res_preview = res.replace("\n", " ")[:30]
|
||||
if len(res) > 30: res_preview += "..."
|
||||
if imgui.button(f"View##res_{i}"):
|
||||
self.text_viewer_title = f"Call Output #{i+1}"
|
||||
self.text_viewer_content = res
|
||||
self.text_viewer_title = f"Tool Call #{i+1}"
|
||||
self.text_viewer_content = combined
|
||||
self.show_text_viewer = True
|
||||
|
||||
imgui.end_table()
|
||||
|
||||
Reference in New Issue
Block a user