mirror of
https://github.com/usestrix/strix.git
synced 2026-08-24 03:42:37 +02:00
Adding more verbose logging for llm failed requests (#30)
This commit is contained in:
+18
-4
@@ -546,11 +546,16 @@ class StrixCLIApp(App): # type: ignore[misc]
|
||||
self._safe_widget_operation(keymap_indicator.update, "")
|
||||
self._safe_widget_operation(status_display.remove_class, "hidden")
|
||||
elif status == "llm_failed":
|
||||
self._safe_widget_operation(status_text.update, "[red]LLM request failed[/red]")
|
||||
error_msg = agent_data.get("error_message", "")
|
||||
display_msg = (
|
||||
f"[red]{error_msg}[/red]" if error_msg else "[red]LLM request failed[/red]"
|
||||
)
|
||||
self._safe_widget_operation(status_text.update, display_msg)
|
||||
self._safe_widget_operation(
|
||||
keymap_indicator.update, "[dim]Send message to retry[/dim]"
|
||||
)
|
||||
self._safe_widget_operation(status_display.remove_class, "hidden")
|
||||
self._stop_dot_animation()
|
||||
elif status == "waiting":
|
||||
animated_text = self._get_animated_waiting_text(self.selected_agent_id)
|
||||
self._safe_widget_operation(status_text.update, animated_text)
|
||||
@@ -633,7 +638,7 @@ class StrixCLIApp(App): # type: ignore[misc]
|
||||
|
||||
for agent_id, agent_data in self.tracer.agents.items():
|
||||
status = agent_data.get("status", "running")
|
||||
if status in ["running", "waiting", "llm_failed"]:
|
||||
if status in ["running", "waiting"]:
|
||||
has_active_agents = True
|
||||
current_dots = self._agent_dot_states.get(agent_id, 0)
|
||||
self._agent_dot_states[agent_id] = (current_dots + 1) % 4
|
||||
@@ -644,7 +649,7 @@ class StrixCLIApp(App): # type: ignore[misc]
|
||||
and self.selected_agent_id in self.tracer.agents
|
||||
):
|
||||
selected_status = self.tracer.agents[self.selected_agent_id].get("status", "running")
|
||||
if selected_status in ["running", "waiting", "llm_failed"]:
|
||||
if selected_status in ["running", "waiting"]:
|
||||
self._update_agent_status_display()
|
||||
|
||||
if not has_active_agents:
|
||||
@@ -652,7 +657,7 @@ class StrixCLIApp(App): # type: ignore[misc]
|
||||
for agent_id in list(self._agent_dot_states.keys()):
|
||||
if agent_id not in self.tracer.agents or self.tracer.agents[agent_id].get(
|
||||
"status"
|
||||
) not in ["running", "waiting", "llm_failed"]:
|
||||
) not in ["running", "waiting"]:
|
||||
del self._agent_dot_states[agent_id]
|
||||
|
||||
def _gather_agent_events(self, agent_id: str) -> list[dict[str, Any]]:
|
||||
@@ -900,6 +905,7 @@ class StrixCLIApp(App): # type: ignore[misc]
|
||||
"reporting_action": "#ea580c",
|
||||
"scan_start_info": "#22c55e",
|
||||
"subagent_start_info": "#22c55e",
|
||||
"llm_error_details": "#dc2626",
|
||||
}
|
||||
|
||||
color = tool_colors.get(tool_name, "#737373")
|
||||
@@ -911,6 +917,14 @@ class StrixCLIApp(App): # type: ignore[misc]
|
||||
if renderer:
|
||||
widget = renderer.render(tool_data)
|
||||
content = str(widget.renderable)
|
||||
elif tool_name == "llm_error_details":
|
||||
lines = ["[red]✗ LLM Request Failed[/red]"]
|
||||
if args.get("details"):
|
||||
details = args["details"]
|
||||
if len(details) > 300:
|
||||
details = details[:297] + "..."
|
||||
lines.append(f"[dim]Details:[/dim] {escape_markup(details)}")
|
||||
content = "\n".join(lines)
|
||||
else:
|
||||
status_icons = {
|
||||
"running": "[yellow]●[/yellow]",
|
||||
|
||||
Reference in New Issue
Block a user