After an agent finishes its task (code, UI, fix, feature), it should prove its work visually. Not just "here's a diff" — but "here's what the app looks like now, here's the test passing, here's the before and after."
Think of it like a contractor showing you photos of the finished room before you sign off. Right now AO agents finish silently — you have to go check yourself.
| Tool | Visual Verification | How |
|---|---|---|
| Devin | Full browser in workspace | Built-in browser shows live app state. User sees what agent sees. |
| 1code | Live browser previews | "Preview dev branches in a real browser" — each worktree gets a live preview URL. |
| OpenHands | Browser tool + workspace | Agent can browse, take screenshots, interact with the app it's building. |
| Goose | Partial — via MCP | Can use browser-use MCP server for web interaction. No built-in visual proof. |
| oh-my-claudecode | QA phase validation | Multi-perspective review (architect + security + code reviewer) but no visual. |
| AO | Nothing | Agent creates PR. No proof of what it looks like. No approval flow. |
↓
↓
↓
"I completed issue #42. Here's what it looks like: [screenshot gallery]. Tests: 14/14 passing. Build: OK. Approve / Request Changes / Reject"
Playwright can take screenshots and record videos of web apps headlessly. It's the standard for browser automation.
# In packages/core/package.json
"optionalDependencies": {
"playwright": "^1.40.0"
}
If Playwright isn't installed, skip visual verification gracefully (just run tests, capture diffs).
VerificationService// packages/core/src/verification-service.ts
interface VerificationResult {
sessionId: string;
timestamp: string;
status: 'passed' | 'failed' | 'needs-review';
// Evidence
screenshots: ScreenshotArtifact[];
testResults: TestResultArtifact | null;
buildStatus: 'success' | 'failure' | 'skipped';
diffSummary: DiffSummaryArtifact;
videoRecording: string | null; // path to .webm
// Approval
approvalStatus: 'pending' | 'approved' | 'rejected' | 'changes-requested';
approvedBy: string | null;
approvedAt: string | null;
}
interface ScreenshotArtifact {
name: string; // e.g. "homepage-after", "login-page-before"
path: string; // path to .png
viewport: string; // e.g. "1280x720", "375x812"
type: 'before' | 'after' | 'comparison';
}
interface VerificationService {
runVerification(sessionId: string, config: VerificationConfig): Promise<VerificationResult>;
getVerification(sessionId: string): Promise<VerificationResult | null>;
approve(sessionId: string, userId: string): Promise<void>;
reject(sessionId: string, userId: string, reason: string): Promise<void>;
requestChanges(sessionId: string, userId: string, comments: string): Promise<void>;
}
After agent pushes code:
package.json scripts for dev, start, serve)http://localhost:{port})// Simplified screenshot capture
async function captureScreenshots(worktreePath: string, port: number): Promise<ScreenshotArtifact[]> {
const browser = await playwright.chromium.launch({ headless: true });
const page = await browser.newPage();
const screenshots: ScreenshotArtifact[] = [];
// Desktop
await page.setViewportSize({ width: 1280, height: 720 });
await page.goto(\`http://localhost:\${port}\`);
await page.waitForLoadState('networkidle');
const desktopPath = path.join(artifactDir, 'screenshot-desktop.png');
await page.screenshot({ path: desktopPath, fullPage: true });
screenshots.push({ name: 'desktop', path: desktopPath, viewport: '1280x720', type: 'after' });
// Mobile
await page.setViewportSize({ width: 375, height: 812 });
const mobilePath = path.join(artifactDir, 'screenshot-mobile.png');
await page.screenshot({ path: mobilePath, fullPage: true });
screenshots.push({ name: 'mobile', path: mobilePath, viewport: '375x812', type: 'after' });
await browser.close();
return screenshots;
}
Take screenshots of the main branch BEFORE spawning the agent (baseline). After agent completes, take new screenshots. Store both and generate a visual diff.
Tools for visual diff: pixelmatch (lightweight), jest-image-snapshot, or simple side-by-side display.
After agent pushes, run the project's test suite:
package.json for test script, or look for pytest, cargo test, go testinterface TestResultArtifact {
runner: string; // 'vitest', 'jest', 'pytest', etc.
total: number;
passed: number;
failed: number;
skipped: number;
coverage: number | null; // percentage
duration: number; // ms
output: string; // truncated test output
failedTests: string[]; // names of failing tests
}
For UI changes, record a short video (5-15 seconds) of the feature in action:
page.video() API.webm artifactThis gives the user a "demo video" of what the agent built — just like a developer would screen-record a feature for a PR review.
New section in SessionDetail.tsx — the verification card:
Three actions:
This closes the loop: agent works → proves it → human approves → PR merges. No context-switching to GitHub.
When verification finishes, notify the user:
# ao.yaml
verification:
screenshots:
enabled: true
viewports:
- { width: 1280, height: 720, name: desktop }
- { width: 375, height: 812, name: mobile }
pages:
- /
- /login
- /dashboard
tests:
enabled: true
command: npm test # override auto-detected
coverageThreshold: 80 # minimum % to pass
video:
enabled: false # opt-in, resource-intensive
duration: 15 # max seconds
build:
enabled: true
command: npm run build
autoApprove:
enabled: false # if ALL checks pass, auto-merge
requireCoverage: 80
requireAllTestsPassing: true
| Component | Tool | Why |
|---|---|---|
| Browser automation | Playwright | Best headless browser API. Supports screenshots, video, multiple viewports. Used by 1code. |
| Visual diff | pixelmatch | Zero deps, fast, lightweight pixel comparison |
| Video encoding | Playwright built-in | page.video() outputs .webm natively |
| Test detection | Custom (read package.json) | Simple heuristic: check for vitest/jest/pytest/cargo test |
10-15 minutes per PR review, mostly manual.
30 seconds per PR review. Visual proof. One click to merge.
ao.yaml