Each web reply has a quiet Details button. It opens a drawer on desktop and a bottom sheet on mobile. Activity starts with collapsed tool calls; Context, Vision and Usage are separate, independently scrollable sections. Payloads are inert text, never executable HTML. The dialog owns Escape and restores focus to its trigger. The existing evidence inspector remains available.
What the record means#
- Context is the initial ordered prompt assembly, routed skill, prior messages and offered tool names. Tool definitions are captured when a call executes.
- Activity observes the actual runner input and guarded tool result returned to the model, with success/failure, elapsed time and execution duration.
- Vision pairs the local capture for that reply with the vision model's returned description. Activity also shows the guarded description sent to the chat model.
- Usage reports provider measurements for chat plus page vision, with separate vision cost. Unknown charges and cache counts are not displayed as zero. Voice transcription and playback are separate calls and are not included.
- Response checker verdicts and escalation model are shown where present. Intermediate candidate answers and private reasoning are never captured. This provider integration currently exposes no reasoning-summary field; the UI says so rather than inventing one.
- Failed model attempts are labelled separately from any deterministic fallback reply. Initial context does not claim to be a full per-iteration provider request archive; subsequent tool results and checker verdicts are shown separately.
Transport, retention and limits#
The authenticated, session-owned SSE route emits versioned turn.inspection
events only to clients declaring reply_details. Existing SSE clients and JSON
clients receive their existing contracts. Inspection observes serving behavior;
it does not change prompts, tools, permission checks or provider calls. Delivery
failure must not fail the underlying turn.
Configuration credentials pass through the existing runtime/broker secret guard. Additional credential-shaped values, URL credentials and embedded data URLs are removed before text is truncated. Redactions and display truncation are marked. There is no unredacted export. Copy details requires a click and excludes images.
Inspection events are never written to server history, trace logs, localStorage or sessionStorage. The browser retains at most eight turns, 100 events / 192,000 characters per turn, and two bounded PNG captures. Closing the chat, reloading or switching sessions clears the records. Disabling screenshots clears all retained images. An unavailable record has an explicit empty state; images are not silently reattached to another reply. Reopening a transcript does not reconstruct lost diagnostics from reply text.
Verification#
The focused route, runner, stream-parser, redaction, lifecycle and drawer unit tests cover the wire contract, owner isolation, no persistence, failed attempts, unknown cost, bounded retention and inert content rendering. Run them with one worker and a bounded Node heap on small hosts.
The browser gate reuses the real auth/SSE/client-capture stack with doubles only at the provider boundary:
pnpm exec playwright test --config apps/oshun/web/playwright.page-inspection.config.ts
It covers desktop and Pixel 7 layouts, actual screenshots and private-pixel exclusion, tool/vision/prompt inspection, keyboard focus, Escape, retention, failure recovery and WCAG AA automation. The focused config starts its own BFF and Next development server. Scoped typechecking, lint and the BFF production bundle are additional gates. Full Next production builds and broad Nx sweeps are excluded on the local 16 GiB host under the repository's memory policy; browser verification exercises Next's actual web compilation.