Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src-tauri/src/openclaw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2949,6 +2949,25 @@ fn finalize_thread_run(
let _ = db.checkpoint_thread_run(run_id, checkpoint_payload_json);
}
let _ = db.finish_thread_run(run_id, final_status, error_payload_json);
// Failed runs must leave a trace in the work log (issue #64): during the
// 2026-08-24 CUJ test a fatal send failure left the Activity tab with no
// record at all, so the log could neither confirm nor deny what the agent
// claimed to be doing. Success already logs "chatted"; this is its
// counterpart, at the single chokepoint every failure path goes through.
if final_status == "failed" {
let summary = error_payload_json
.and_then(|p| serde_json::from_str::<serde_json::Value>(p).ok())
.and_then(|v| v["error"].as_str().map(|e| e.to_string()))
.unwrap_or_else(|| "Run failed with no recorded error detail.".to_string());
let detail: String = summary.chars().take(300).collect();
let _ = db.log_audit(
agent_id,
"run_failed",
Some("openclaw"),
&format!("Attempted a task and failed: {}", detail),
None,
);
}
let _ = refresh_thread_context_files(db, agent_id, conversation_id);
clear_thread_cancellation_requested(agent_id, conversation_id);
}
Expand Down
28 changes: 26 additions & 2 deletions src/pages/ArchitectView/ActivityTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,27 @@ function ActivityTab({ agent, onNavigate }: { agent: AgentData; onNavigate?: (ta
// Map tier to a 0–2 position on the green→amber→red gradient track.
const tierPosition = currentTier?.id === "unrestricted" ? 2 : currentTier?.id === "balanced" ? 1 : 0;

// Work-log entries speak infrastructure ("FILES_BRIDGE_SYNCED VIA FILES");
// the log is for the person deciding whether to trust the agent, so render a
// human action narrative and keep the machine code in the hover title
// (issue #64, 2026-08-24 CUJ test).
const humanizeAuditAction = (action: string, bridgeType?: string | null): string => {
const known: Record<string, string> = {
chatted: "Chat",
created: "Created",
updated: "Updated",
delete: "Deleted",
run_failed: "Task failed",
files_bridge_synced: "Files synced",
bridge_access: "Used a connected service",
bridge_enabled: "Service connected",
bridge_disabled: "Service disconnected",
};
const base = known[action.toLowerCase()] || action.replace(/_/g, " ").toLowerCase();
const via = bridgeType && !["openclaw", "files"].includes(bridgeType.toLowerCase()) ? ` via ${bridgeType}` : "";
return `${base}${via}`;
};

const groupedLogs = useMemo(() => {
if (!recentLogs || recentLogs.length === 0) return [];

Expand Down Expand Up @@ -256,8 +277,11 @@ function ActivityTab({ agent, onNavigate }: { agent: AgentData; onNavigate?: (ta
return (
<div key={group.id} style={{ fontSize: 13, color: "var(--text-main)", padding: "10px 14px", background: "var(--surface-base)", borderRadius: 8, border: "1px solid var(--border-subtle)", display: "flex", flexDirection: "column", gap: 4 }}>
<div style={{ display: "flex", justifyContent: "space-between", alignItems: "center" }}>
<strong style={{ color: color, fontSize: 11, textTransform: "uppercase", letterSpacing: "0.05em", background: bg, padding: "2px 6px", borderRadius: 4 }}>
{log.action} {log.bridge_type ? `via ${log.bridge_type}` : ""}
<strong
title={`${log.action}${log.bridge_type ? ` via ${log.bridge_type}` : ""}`}
style={{ color: color, fontSize: 11, textTransform: "uppercase", letterSpacing: "0.05em", background: bg, padding: "2px 6px", borderRadius: 4 }}
>
{humanizeAuditAction(log.action, log.bridge_type)}
</strong>
<span style={{ fontSize: 11, color: "var(--text-muted)" }}>
{new Date(log.timestamp).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}
Expand Down
Loading