Skip to content

Persistent HTML report after a run (video, screenshots, network, traces) - Playwright HTML-report style #1967

Closed

Description

@Akshay090

Summary

After I drive a flow with agent-browser (CLI or coding agent), I want a persistent, shareable HTML report of what ran — not only the live dashboard.

Today the observability dashboard is live-only. Once the session closes, I cannot go back and see what was executed. I want an artifact I can open later (or attach to a PR / Slack thread) with:

  • Timeline of commands
  • Screenshots
  • Session video
  • Network activity
  • Traces (or equivalent)

This is the same job Playwright’s HTML reporter / Trace Viewer does for Playwright Test (npx playwright show-report).

Problem

agent-browser dashboard is excellent for watching a run as it happens (viewport, Activity, Console, Network). It is not a record of a finished run.

If a coding agent verifies a page and then closes the session, there is no first-class way to:

  1. Replay the steps
  2. Hover a timeline and see the page at that moment
  3. Inspect network/console for that session after the fact
  4. Hand someone a single folder/URL instead of a pile of screenshots

record start/stop gives a WebM; screenshot gives a PNG; trace start/stop gives Chrome tracing JSON. Those are useful pieces, but they are not one reviewable report, and agents cannot query a Chrome trace without a GUI (related: #1280).

What I want

An opt-in “save report” at the end of a session (or wrapping a batch / agent run), producing a local HTML report I can open without keeping the browser or dashboard up.

Suggested contents (Playwright HTML report / Trace Viewer as the UX bar, not necessarily the same engine):

Artifact Why
Command timeline What the agent/CLI actually did, with timestamps
Screenshots Before/after or per navigation
Video / screencast Visual replay of the session
Network log Failed requests, API calls during the flow
Trace (or HAR + actions) Debug “why did this click miss / why did we land on sign-in”
Console errors/warnings Same as dashboard Console, persisted

Ideal UX: something I can open locally like playwright show-report (e.g. agent-browser report show <dir> on 127.0.0.1). Does not need to upload anywhere.

Proposed shape (for discussion)

Keep the dashboard live. Add a session archive:

agent-browser --session verify-dashboard open https://example.com/app
# ... clicks / snapshots ...
agent-browser --session verify-dashboard report save ./ab-report
agent-browser report show ./ab-report

Activity

  1. Hronom commented on Sep 21, 2026

    @Hronom

    One boundary that seems important for the first version: make the archive a run receipt, not just a media bundle. I would keep separate states for requested, dispatched, observed, and verified, each bound to session or profile generation, target fingerprint, origin, and timestamp. A screenshot or video proves what was rendered, not that a write succeeded; the report should show the authoritative fixture read-back separately. If record stop, browser close, or artifact generation is interrupted, mark the report partial or unknown rather than presenting a complete run.

    For a shareable local report, I would also make redaction defaults explicit: omit cookies, authorization headers, form values, and bodies from network or console capture; use host and secret-pattern allowlists; include an artifact manifest with hashes and missing-artifact reasons. A disposable public or localhost fixture plus clean-quit and crash tests would make the report contract reproducible without uploading anything.

    I maintain Hronaut, a local visible Browser/MCP workspace, and we use these distinctions when checking workspace and tab continuity. AI-assisted; no private run data or integration claim.

  2. christianfrei791 commented on Sep 21, 2026

    @christianfrei791

    To move this toward a structured "run receipt" as suggested by Hronom, we could implement a post-session hook in the agent orchestrator that serializes the internal state manager's history into a JSON manifest alongside the raw artifacts. If we standardize this manifest, we could bundle it with a static HTML viewer—effectively a simplified version of the Playwright Trace Viewer—that maps the SessionID to specific Action timestamps and network logs. Would it be feasible to extend the current browser.close() flow to trigger an export_session_artifacts() method that aggregates these disparate logs into a single directory before cleanup?

  3. Hronom commented on Sep 21, 2026

    @Hronom

    Yes, a post-session hook is a good boundary, but I would not make a successful browser.close() the only condition for a usable receipt.

    A small finalization state machine could make the failure modes explicit:

    1. Create the manifest at run start with session/profile generation, event-sequence start, target fingerprint and intended artifact set.
    2. Append action/observation events as they occur; keep the event sequence durable enough to survive a close timeout.
    3. On close, stop admitting new actions, snapshot the in-memory state, flush the raw artifacts, compute hashes, and atomically write a COMPLETE manifest only after every required artifact is present.
    4. If close, flush, or artifact assembly is interrupted, write PARTIAL or UNKNOWN with missing-artifact reasons and the last durable sequence; never delete raw evidence before that state is durable.
    5. Make finalization idempotent by session/run generation so a retry cannot duplicate or silently replace a receipt.

    I would test clean close, already-closed browser, close timeout, process crash during flush, concurrent close calls, zero-action runs, a late event after the close barrier, and an artifact that is present but fails hash/read-back. The static viewer can then render the same manifest whether the browser closed cleanly or the orchestrator had to recover it. Keep the existing redaction defaults for cookies, authorization headers, form values and bodies.

  4. locked and limited conversation to collaborators on Nov 3, 2026
  5. converted this issue into a discussion #2322 on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions