feat(playwright): unwrap report.json suite + reasoning-driven screen capsule#4
Merged
Merged
Conversation
… capsule
The agent-browser-driver adapter read .agentResult/.turns, but the driver's
canonical on-disk artifact is a TestSuiteResult ({ results: TestResult[] }) —
so spansFromPlaywrightResult(report.json) returned zero spans and rendered an
empty video. Accept the suite shape and map results[0] (first case; multi-case
selection stays a CLI concern).
The driver records per-turn reasoning on attributes.reasoning, but the screen
capsule dropped it. Thread it through ScreenStep into the caption as a 💭
thinking line, so a browser run renders as a reasoning-driven screencast.
drewstone
added a commit
to tangle-network/browser-agent-driver
that referenced
this pull request
Jun 21, 2026
A run's report.json already carries per-turn screenshot + action + reasoning, so it renders directly into a screen/replay video via run-capsule with no extra capture step. Documents the one-liner under Session Viewer, the screenshot (vision-on) requirement, and the dependency on the suite-aware adapter (tangle-network/run-capsule#4).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
run-capsule --playwright report.jsonsilently produced an empty video for@tangle-network/browser-agent-driver(bad) runs. Two gaps:spansFromPlaywrightResultread.agentResult/.turns, but the driver's canonical on-disk artifact is aTestSuiteResult({ results: TestResult[] }). Neither key existed at the top level →turns = []→ 0 spans → blank capsule.attributes.reasoning, but the screen capsule only captioned the action + URL — so a browser run never rendered as the "thinking-driven" screencast it could be.What
adapters/playwright.ts): accept the suite shape and mapresults[0](first case by default; multi-case selection stays a CLI concern). BareTurn[], singleTestResult, andagentResultinputs are unchanged.renderers/screen-capsule.ts): threadreasoningfromattributes.reasoning(fallbacks:attributes.thought,result.reasoning) throughScreenStepinto the caption as a 💭 line (whitespace-collapsed, clamped to 280 chars + 2 CSS lines).Verification
End-to-end against real
badreport.jsonfiles (not fixtures):screen.mp4(1280×720, 6.3s) +replay.mp4— real product frames, action captions.Gate:
pnpm typecheckclean,pnpm test43/43 pass (2 new: suite-unwrap, reasoning-on-step).Scope
Additive and backward-compatible — no field removed or renamed; every previously-accepted input shape still maps identically.