You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Agent observation cards now reconstruct full activity detail on session reload, matching the live streaming view. Previously, reloading a session showed only 2 agents (those with state files) and displayed "No activity recorded" — now all 29+ agents appear with granular tool-by-tool activity logs including durations, success/failure, search queries, and file targets.
toolTimers Map: PreToolUse→PostToolUse elapsed time → duration_ms
agentTimers Map: SubagentStart→SubagentStop elapsed time → duration_ms
Per-hook-type success derivation (!tool_response.isError, false for failures, true for agents)
Compact tool_input extraction: query/pattern/command/url into event_data JSONB
WebSearch/WebFetch native SDK tool name matching (alongside MCP variants)
AUDIT_SKIP_TOOLS emptied — Read/Grep/Glob now persisted to hook_audit_log
persistState reads input.duration_ms for agent_states table
Backend — Query & API (dbFrontendRouter.js, postgres.js)
UNION ALL query: stateless research agents sourced from hook_audit_log SubagentStop
GET /api/db/sessions/:key/agent-events/:agentType — per-agent tool event feed
agentType regex validation (/^[a-z0-9_-]+$/i)
Composite index idx_audit_session_agent_event_time
Frontend — Playing Card Popup (app.js, styles.css)
Async activity feed: fetches granular events from DB, renders tool/target/context/duration
renderAgentStats() called on reload (stats grid populated)
CSS .detail-* rules scoped under .agent-obs-activity (cascade fix)
Activity feed max-height: 200px → 320px
Remaining Frontend Enhancements
The following items would further close the gap between live and reload views:
Transcript summary fallback — when DB events are unavailable (pre-v4.10.0 sessions), parse transcript_summary from SubagentStop event_data for a condensed activity view
Live-to-reload parity for running agents — agents that were actively running at time of page close don't get agent_type written at completion; capture in-progress state
Rapid popup race condition — if user opens/closes popups quickly, pending fetch could write to wrong #agentObsActivityFeed element; add generation counter or AbortController
Gate check detail in popup — show individual gate check pass/fail (data exists in event_data.gate_checks_passed/total) as a visual checklist
Tool usage breakdown chart — render tool category distribution (WebSearch, MCP, Read/Write, Bash) as a mini bar chart in the popup header area
Duration sparkline — visualize per-tool durations as a horizontal bar or sparkline in the activity feed
Backfill script — one-time migration to compute duration_ms for existing SubagentStop events from SubagentStart/Stop timestamp deltas in hook_audit_log
Test Plan
All 4 modules import cleanly (hookDBBridge, hookDBBridgeConfig, dbFrontendRouter, postgres)
Summary
Agent observation cards now reconstruct full activity detail on session reload, matching the live streaming view. Previously, reloading a session showed only 2 agents (those with state files) and displayed "No activity recorded" — now all 29+ agents appear with granular tool-by-tool activity logs including durations, success/failure, search queries, and file targets.
Version: v4.10.0
Commit: f58e960
Changes
Backend — Hook Data Enrichment (
hookDBBridge.js)toolTimersMap: PreToolUse→PostToolUse elapsed time →duration_msagentTimersMap: SubagentStart→SubagentStop elapsed time →duration_mssuccessderivation (!tool_response.isError,falsefor failures,truefor agents)tool_inputextraction: query/pattern/command/url intoevent_dataJSONBWebSearch/WebFetchnative SDK tool name matching (alongside MCP variants)AUDIT_SKIP_TOOLSemptied — Read/Grep/Glob now persisted tohook_audit_logpersistStatereadsinput.duration_msforagent_statestableBackend — Query & API (
dbFrontendRouter.js,postgres.js)hook_audit_logSubagentStopGET /api/db/sessions/:key/agent-events/:agentType— per-agent tool event feedagentTyperegex validation (/^[a-z0-9_-]+$/i)idx_audit_session_agent_event_timeFrontend — Playing Card Popup (
app.js,styles.css)renderAgentStats()called on reload (stats grid populated).detail-*rules scoped under.agent-obs-activity(cascade fix)Remaining Frontend Enhancements
The following items would further close the gap between live and reload views:
transcript_summaryfrom SubagentStopevent_datafor a condensed activity viewagent_typewritten at completion; capture in-progress state#agentObsActivityFeedelement; add generation counter or AbortControllerevent_data.gate_checks_passed/total) as a visual checklistduration_msfor existing SubagentStop events from SubagentStart/Stop timestamp deltas inhook_audit_logTest Plan
.detail-*rules, 8 scoped ruleswrapHooksForDBno-pool passthrough: returns original config unchangedCREATE INDEX IF NOT EXISTS)🤖 Generated with Claude Code