ReadingResearchRadarInvestment framework
Sign in / Sign up
← Back to reading
NewsTopic · AI Agent UI VerificationMaterial3 min readDisconfirmAI Editorial

swyx: AI Agents Build Plausible But Wrong UIs — The Fix Is Making Each Bug Fail CI

After having an agent audit Forge, the GitHub clone swyx built with AI coding agents, the top findings were not aesthetic. PR counts capped at 30, every row showed fake zero diff stats, all buttons rendered in the primary color because Tailwind purged dynamically built class names, and fourteen pages had no real error state. The fix was four small PRs plus a fifth that turns each bug class into a check that fails CI.

2026-11-27

When swyx had an agent audit Forge — the GitHub + Actions + Vercel clone he built with AI agents on Cloudflare — the findings weren't aesthetic. The UI looked crafted: workshop theme, custom type, a mascot. But it was confidently showing wrong information. PR counts stopped at 30 because the list fetched one page per state and counted the page, while the repo actually had 229 merged PRs. Every PR row displayed "+0 -0 across 0 files" because the list API never returns diff stats, so the UI printed zeros that nobody questioned. Every button was the same orange, because Tailwind v3 purges class names that don't appear literally in source, and forge-button--secondary was built from a template string. Fourteen pages showed nothing but a red "Error: Not found" line when a load failed.

His central observation: agents optimize for plausible, not true. A page can render, pass typecheck, and look correct in a screenshot while showing numbers no one checked against real data. The "+0 -0 across 0 files" line is the perfect example — well formatted, in the right place, wrong on every row. Nobody notices a plausible zero.

The bugs that matter, he argues, live between layers. The orange buttons were correct TSX producing incorrect CSS. The count of 30 was a correct component on top of a pagination assumption. Unit tests at one layer don't catch these, but a browser does. This is the kind of bug agents make and reviewers miss: the code reads correctly, the types are correct, and if there's a test, it checks that the class string is right — and it is. Only the built CSS is wrong.

Sign in / Sign up
ReadingResearchRadarInvestment framework

The fix took four small PRs, each web-only and independently mergeable. PR 274 replaced the fake zero-diff line, switched counts to the API's pagination.total with a "Show more" button past 30, and introduced a shared state pill with icon and 13px label. PR 275 made repo tabs visible: open PR and issue counts sit on the tabs, unused sections collapse to muted icons with tooltips, and tabs wrap or scroll with an edge fade instead of clipping. PR 276 stopped the Contents box from stacking one per markdown block. PR 277 added hover peek cards showing state, key fields, and a JSON link — and crucially, each peek target carries data-forge-kind, data-forge-ref, and data-forge-api attributes, making the DOM itself a machine-readable map for agents.

Then came the fifth PR: guardrails. Each bug class became a check that fails CI. Every class in @layer components must appear literally in source. No class names built from template strings. No bare Error: {...} lines. A catch-all route must exist. Every code path that signs someone in must record the method and offer the passkey.

Against production, the browser sweep (npm run ui:sweep) found 12 issues across 32 page views. Locally, with everything merged, it finds 0 across 38. It also caught two things nobody had reported: the README was 551px wide on phones because long inline code didn't wrap, and the top bar overflowed at 408–433px.

The structural problems remain. The PR page can't answer "can I merge this?" — it says "Ready to merge" with zero checks listed. The app has four page widths and two repo header styles. Home is a profile, not an inbox. At 1440px, the PR list shows five PRs per screen in 96px cards; a developer tool should show three times that. The workshop theme leaks into labels: 39 files put a themed eyebrow over the heading ("Joining bench", "Change gauge", "Threshold ledger"). These are redesign proposals, not completed fixes.

What this adds for anyone shipping AI-built frontends: the defense isn't more code review or better prompts. It's encoding each specific failure pattern as a check that fails before merge. The agents will write the next thousand lines. Leave them a test that fails, not a lesson they'll forget.

Sources

  • swyx.ioswyx's site↗
Topic

AI Agent UI Verification

AI coding agents frequently generate user interfaces that appear visually plausible but contain functional or visual err…

5 steps1 piecesUpdated 2026-11-27 14:04

How it got here

  1. 2024-07-172024-07-17: AUITestAgent, developed by Fudan University and Meituan, was introduced as the first automatic, natural language-driven GUI testing tool capable of fully automating interaction and function verification.rainpot.github.io ↗
  2. 2025-10-062025-10-06: Researchers from Clausthal University of Technology and Karlsruhe Institute of Technology published GUISpector, a framework leveraging MLLM agents to automatically verify natural language requirements in GUI prototypes.arxiv.org ↗
  3. 2026-07-162026-07-16: Verfix v0.4.1 results showed that agents using its deterministic browser verification achieved higher loop closure rates (e.g., Codex at 88%) compared to manual or improvised checks.verfix.dev ↗

What is still unsettled

  • How can teams effectively manage visual baselines when AI agents frequently refactor code, potentially breaking pixel-perfect comparisons?
  • What is the optimal threshold for distinguishing between acceptable minor rendering differences and actual functional bugs in cross-browser automated testing?
  • Can deterministic verification tools adapt quickly enough to handle novel UI patterns generated by agents that do not fit existing test flows?
Read the full topic →
Continue researching →