Session Inspector
7-tab deep-debug inspector.
The Session Inspector is a deep-debug panel that exposes every internal signal from an agent run - tool calls with full I/O, derived context keys, architectural decision provenance, stuck-signal health, aggregate tool statistics, and raw logs - organized into seven tabs over a live SSE connection.
Navigation
/[orgSlug]/[projectSlug]/sessions/[id]/inspectThe Inspector is reached by clicking the Inspect button on a Session Detail page, or by navigating directly with a session's 16-character public ID.
Live Connection
The Inspector connects to the session's SSE stream (GET /api/sessions/[id]/stream) via the useSatelliteInspector hook. Connection state is displayed in the header:
| Indicator | Meaning |
|---|---|
| Wifi icon (connected) | Live updates flowing; data is real-time |
| Wifi-off icon (disconnected) | Polling fallback active; data refreshes every ~15s |
For completed sessions the SSE connection closes gracefully after terminal activities are received, and the Inspector switches to the static persisted view.
The Seven Tabs
Activity Stream
A chronological feed of every activity the agent emitted during the session. Each activity has a type (thought, action, response, error) and a timestamp. Activities are the same data the Activities API returns - the Inspector just renders them with full formatting and diff highlighting for multi-turn edits.
Activities are stored in an in-process ring buffer while the session is active, and persisted to session_activities rows in Postgres for completed sessions.
Tool Call History
Every tool invocation the agent made, with full inputs and outputs expanded by default. Useful for debugging incorrect edits, failed searches, or unexpected file reads.
Each row shows:
- Tool name (MCP-qualified, e.g.
mcp__af-code__af_code_search_symbolsor bareBash) - Success / failure badge
- Duration
- Collapsed input/output JSON (click to expand)
Failed calls are highlighted in red and counted in the tab badge.
Context Browser
The derived context facets the platform extracted from this session's tool calls. Context derivation runs as a post-tool-use hook and produces structured DerivedContextEntry values - see Context Derivation for the full heuristic table.
Facets shown:
| Key | What it captures |
|---|---|
currentFile | Last file read by Read / View / cat |
lastEditedFile | Last file written by Write / Edit / Create |
lastSearch | Most recent Grep / Search / Find pattern or af_code_* query |
lastGitOp | Most recent git … command from a Bash invocation |
workingDirectory | Most recent cd destination from a Bash invocation |
lastTestRun | Most recent test command (pnpm test, vitest, jest, etc.) |
lastMemoryOp | Most recent af_memory_remember / af_memory_recall operation |
lastSubAgentDispatch | Description passed to the most recent Task / Agent tool call |
Decision Provenance
Architectural decisions the platform extracted from the agent's tool calls - file edits, architecture queries, and structural reasoning patterns. This tab correlates with the graph context injection system: decisions captured here feed the knowledge graph and appear in future session context budgets.
Each decision entry shows the source tool call that triggered extraction, the inferred decision type, and the affected paths or components.
Health
The same stuck-signal summary shown on the Session Detail page, but updated live via the SSE connection. The four signal types are:
- Long Running - session exceeds SLA threshold
- Stale Heartbeat - worker heartbeat overdue
- Tool Loop Stuck - same tool called repeatedly without progress
- Claim Stuck - claim lock held but no active polling
The Health tab also shows the last heartbeat timestamp and the worker's CPU/uptime when available.
Tool Statistics
Aggregate counts and durations across all tool calls in the session:
- Total tool calls
- Unique tools used
- Error rate
- Average tool duration
- Top-N tools by call count
This tab is the fastest way to spot pathological patterns - a session that spent 90% of its tool budget on Bash retries, or an unexpectedly high rate of Read calls against generated files.
Log Viewer
Raw log lines streamed from the worker process for this session. Log output includes the daemon's stdout for the session's execution context - useful when a tool call's JSON output looks correct but the underlying command behaved differently than expected.
Logs are streamed via the same SSE connection as activities; for completed sessions they're replayed from the persisted log buffer.
Typical Debugging Workflow
Open the Inspector for the failing session. Check the Health tab first - if a stuck signal is active, that's the proximate cause.
Switch to Calls and filter to failed tool invocations (red badge). Expand the inputs/outputs to find the root failure.
Check Context to confirm the agent had the right working directory and last-edited file at the time of the failure.
If the agent made an incorrect architectural assumption, check Decisions to see what was in the context budget.
For daemon-level failures (crashes, permission errors), check Logs for the raw process output.
Related Pages
- Session Detail - activity stream and health diagnostics
- Session List - project-scoped session list
- Context Derivation - how tool calls become context facets
- Activities API - programmatic access to the activity feed
- Session Topology - fleet-wide session graph