How Claude agents built peer-to-peer calling in Homebase Chat, and what they missed


The technical side (state machine, signalling over your own server, the video ladder, the WebRTC lessons) has its own note: Homebase Chat calling: the technical architecture. This one is about the process.

The 64 hours, at a glance

The first commit landed on 11 October at 22:58 UTC. The 11-PR stack (#1877 to #1930) merged on 14 October at 14:29 UTC. Within the hour the first crash fix was open. Tap any event to see what happened.

const css = `
.jx{box-sizing:border-box;cursor:pointer;user-select:none;transition:background-color 180ms ease-out,border-color 180ms ease-out,color 180ms ease-out,transform 150ms ease-out}
.jx:hover{border-color:var(--ring)}
.jx:active{transform:scale(0.985)}
.jx:focus{outline:none}
.jx:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
@keyframes jin{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
.jin{animation:jin 200ms ease-out both}
.jexp{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows 220ms ease-out,opacity 220ms ease-out}
.jexp[data-open="true"]{grid-template-rows:1fr;opacity:1}
.jexp>div{overflow:hidden;min-height:0}
@media (prefers-reduced-motion: reduce){.jx,.jexp{transition:none}.jx:active{transform:none}.jin{animation:none}}
`;

function P({ on, active, className = '', children }) {
  return (
    <div
      role="button"
      tabIndex={0}
      aria-pressed={active}
      onClick={on}
      onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); on(); } }}
      className={'jx ' + className}
    >
      {children}
    </div>
  );
}

const kinds = {
  steer: { label: 'Owner steer', cls: 'bg-blue-50 text-blue-900 border-blue-500' },
  run: { label: 'Harness run', cls: 'bg-muted text-foreground border-border' },
  pr: { label: 'PR', cls: 'bg-green-50 text-green-900 border-green-500' },
  fail: { label: 'Post-merge failure', cls: 'bg-red-50 text-red-900 border-red-500' },
};

const events = [
  ['10-09 11:26', 'steer', 'Status of P2P calling?', 'The owner asks what the server side already supports and how to plan the call screens. An agent writes a plan in Journal: audio first, video as a toggle, desktop out of v1 because "Desktop JVM has no good WebRTC".'],
  ['10-11 22:38', 'steer', 'Build it overnight, desktop too', 'The kickoff: design a harness that runs all night from the plan. "Make sure to do it also for the desktop. We also support the desktop as well." That overruled the plan\'s v1 scope.'],
  ['10-11 22:42', 'run', 'call-harness #1 (3.7 h, 18 agents)', 'Library choice, state machine, call screens, signalling over the live relay, ringing. First commit at 22:58.'],
  ['10-12 09:58', 'run', 'call-harness device rounds (8.4 h, 39 agents)', 'Real calls between the Redmi, the iPhone and the Mac. The most expensive calling run, about $102 by transcript estimate.'],
  ['10-12 16:46', 'steer', 'Desktop calls get their own window', '"I still want to access my chats while I can be on a call. That\'s how Telegram, Signal, and WhatsApp does." The agent confirmed the call screen covered the whole main window.'],
  ['10-12 18:08', 'steer', '"You can\'t blame the decoder"', 'The agent had blamed the Redmi\'s hardware for its failures. The owner pointed out Signal and WhatsApp run fine on the same phone. The agent took it back and went to the logs.'],
  ['10-12 18:20', 'steer', 'Retest only what failed', '"Fix those which failed, the correct things will remain corrected. You are wasting tokens on that." The device-round run was stopped here.'],
  ['10-12 18:22', 'run', 'call-fix rounds (4 runs overnight)', 'Each run took the list of items that failed on a device, fixed them one by one, and retested only those.'],
  ['10-12 19:59', 'steer', 'A Calls tab', '"Calls should be in its own bottom navigation bar." Built the next day as #1904.'],
  ['10-13 01:51', 'run', 'desktop-call-harness (7.7 h, 39 agents)', 'Listed what the desktop app lacked against Telegram, Signal, WhatsApp and Meet, then built the call window, device switching and the mini window.'],
  ['10-13 11:46', 'steer', '1080p is a ceiling, not a target', 'The owner\'s "1080p till 480p" had been read as a range with a floor. "I just gave an estimate. It should be adaptive."'],
  ['10-13 14:41', 'steer', 'Slow phones: performance over pixels', '"If there are low powered phones, they should target performance." This became the load rung in the video ladder.'],
  ['10-13 15:46', 'steer', 'Review at every checkpoint', 'An end-of-run simplify found eight design problems too late. From now on every slice gets a review and a simplify before the next one starts.'],
  ['10-13 21:14', 'steer', 'Drop to 720p', 'After the agents compared Signal and Telegram: both cap at 720p. The 1080p cap went.'],
  ['10-13 21:17', 'steer', '"Show me the proof"', 'The owner asked for evidence that VP8 on iPhone is software. The agent cited the lines in libwebrtc and proposed fixing the Android decoder instead.'],
  ['10-13 22:09', 'steer', 'No dark launch: "we launch it"', 'A minute after asking for a developer toggle, the owner cancelled it.'],
  ['10-14 01:57', 'run', 'call-fix-tonight (4.4 h, 31 agents)', 'The Signal-baseline fixes: iPhone capture format, audio mode, picture-in-picture, camera-off signal, the encryption sheet.'],
  ['10-14 08:14', 'run', 'call-fix-morning (1.8 h, 10 agents)', 'Fixed the decoder wrapper that had crashed the Redmi that morning, and verified the fix on the phone.'],
  ['10-14 08:38', 'steer', 'Video calls answer with video', '"A video call should be answered with video only, and an audio call can be upgraded to video mid session." This led to the idle video transceiver.'],
  ['10-14 14:29', 'pr', '#1930 merged', 'The 11-layer stack lands on main through its top PR.'],
  ['10-14 15:21', 'fail', 'Desktop crashes (#1934, #1935)', 'The installed desktop app crashed when a call window opened, then about 10 s after launch. A test had supplied the missing dependency itself.'],
  ['10-14 15:48', 'fail', 'Release APK aborts on first call (#1936)', 'R8 stripped WebRTC classes that native code looks up by name. Debug builds are not minified.'],
  ['10-14 16:20', 'fail', 'Voice caller crashes on answer (#1939)', '"RtpSender has been disposed." The idle video sender from the 08:38 decision was cached across a call Android disposes it on.'],
  ['10-14 16:20', 'pr', 'Calling goes behind a toggle (#1938)', 'Default off, Settings > Apps, while in beta.'],
];

export default function App() {
  const [filter, setFilter] = useState('all');
  const [open, setOpen] = useState(19);
  const shown = events.map((e, i) => [e, i]).filter(([e]) => filter === 'all' || e[1] === filter);
  return (
    <div className="space-y-3">
      <style>{css}</style>
      <div className="flex flex-wrap gap-2">
        {['all', ...Object.keys(kinds)].map((k) => (
          <P key={k} on={() => setFilter(k)} active={filter === k} className={'rounded-full border px-3 py-1 text-xs ' + (filter === k ? 'bg-primary text-primary-foreground' : 'bg-muted')}>
            {k === 'all' ? 'Everything' : kinds[k].label}
          </P>
        ))}
      </div>
      <ol key={filter} className="jin space-y-1" style={{ margin: 0, paddingLeft: 0, listStyle: 'none' }}>
        {shown.map(([e, i]) => (
          <li key={i}>
            <P on={() => setOpen(open === i ? -1 : i)} active={open === i} className={'w-full rounded-lg border p-2 text-left ' + kinds[e[1]].cls}>
              <div className="flex flex-wrap items-center gap-2">
                <span className="text-xs tabular-nums text-muted-foreground">{e[0]} UTC</span>
                <span className="text-sm font-medium">{e[2]}</span>
              </div>
              <div className="jexp" data-open={open === i}><div><p className="pt-1 text-sm" style={{ margin: 0 }}>{e[3]}</p></div></div>
            </P>
          </li>
        ))}
      </ol>
      <p className="text-xs text-muted-foreground">Run times are from the first to the last agent message of each run; some runs overlapped. Failure and fix times are when the fix PR was opened.</p>
    </div>
  );
}

First commit to merge

11 Oct 22:58 to 14 Oct 14:29 UTC, about 64 hours

Size of the stack

259 commits, +26,847 / −161 lines

Harness runs

14 calling workflow runs, 210 agents

One-off subagents

92 (reviews, root-cause hunts, device checks, Journal reports)

Measured cost of the session

$585.52 (Claude Code /cost)

What it cost

The session that ran the build reports its own cost through Claude Code's /cost. The owner read it on 14 October:

Input

Output

Cache read

Cache write

Cost

Opus

1.7 M

3.8 M

1.1 B

22.1 M

$486.91

Sonnet

356.4 K

1.5 M

430.1 M

10.0 M

$98.48

Haiku

133.0 K

24.8 K

1.1 M

186.5 K

$0.12

Total

$585.52

/cost also reports 14 h 19 m of API time, 1 day 16 h of wall time, and 9,407 lines added and 935 removed.

import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend } from 'recharts';

const css = `
.jx{box-sizing:border-box;cursor:pointer;user-select:none;transition:background-color 180ms ease-out,border-color 180ms ease-out,color 180ms ease-out,transform 150ms ease-out}
.jx:hover{border-color:var(--ring)}
.jx:active{transform:scale(0.985)}
.jx:focus{outline:none}
.jx:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
@keyframes jin{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
.jin{animation:jin 200ms ease-out both}
@media (prefers-reduced-motion: reduce){.jx{transition:none}.jx:active{transform:none}.jin{animation:none}}
`;

function P({ on, active, className = '', children }) {
  return (
    <div
      role="button"
      tabIndex={0}
      aria-pressed={active}
      onClick={on}
      onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); on(); } }}
      className={'jx ' + className}
    >
      {children}
    </div>
  );
}

const measured = [
  { name: 'Opus', cost: 486.91, output: 3.8, cacheRead: 1100, cacheWrite: 22.1 },
  { name: 'Sonnet', cost: 98.48, output: 1.5, cacheRead: 430.1, cacheWrite: 10.0 },
  { name: 'Haiku', cost: 0.12, output: 0.0248, cacheRead: 1.1, cacheWrite: 0.1865 },
];

const runs = [
  { run: 'harness #1', opus: 9.95, sonnet: 15.77 },
  { run: 'harness #2', opus: 9.61, sonnet: 4.06 },
  { run: 'device rounds', opus: 66.96, sonnet: 35.27 },
  { run: 'fix 1', opus: 27.98, sonnet: 21.91 },
  { run: 'fix 2', opus: 8.92, sonnet: 4.92 },
  { run: 'fix 3', opus: 19.92, sonnet: 9.74 },
  { run: 'fix 4', opus: 5.6, sonnet: 0.29 },
  { run: 'desktop plan', opus: 1.84, sonnet: 0.34 },
  { run: 'desktop', opus: 63.31, sonnet: 27.74 },
  { run: 'calls tab', opus: 11.2, sonnet: 8.72 },
  { run: 'fix tonight', opus: 29.56, sonnet: 11.95 },
  { run: 'fix morning', opus: 10.02, sonnet: 10.36 },
];

const views = {
  cost: ['Cost (USD)', 'cost'],
  output: ['Output tokens (millions)', 'output'],
  cacheRead: ['Cache reads (millions)', 'cacheRead'],
  cacheWrite: ['Cache writes (millions)', 'cacheWrite'],
};

export default function App() {
  const [tab, setTab] = useState('measured');
  const [view, setView] = useState('cost');
  const [reduced] = useState(() => { try { return window.matchMedia('(prefers-reduced-motion: reduce)').matches; } catch (e) { return false; } });
  const anim = { isAnimationActive: !reduced, animationDuration: 250, animationEasing: 'ease-out' };
  const Btn = ({ v, cur, set, children }) => (
    <P on={() => set(v)} active={cur === v} className={'rounded-full border px-3 py-1 text-xs ' + (cur === v ? 'bg-primary text-primary-foreground' : 'bg-muted')}>{children}</P>
  );
  return (
    <div className="space-y-3">
      <style>{css}</style>
      <div className="flex flex-wrap gap-2">
        <Btn v="measured" cur={tab} set={setTab}>Measured, by model</Btn>
        <Btn v="runs" cur={tab} set={setTab}>Estimated, by harness run</Btn>
      </div>
      {tab === 'measured' ? (
        <div key="measured" className="jin space-y-2">
          <div className="flex flex-wrap gap-2">
            {Object.entries(views).map(([k, [label]]) => <Btn key={k} v={k} cur={view} set={setView}>{label}</Btn>)}
          </div>
          <ResponsiveContainer width="100%" height={220}>
            <BarChart data={measured} margin={{ left: -10 }}>
              <CartesianGrid strokeDasharray="3 3" vertical={false} />
              <XAxis dataKey="name" />
              <YAxis />
              <Tooltip />
              <Bar key={view} {...anim} dataKey={views[view][1]} name={views[view][0]} radius={[4, 4, 0, 0]} />
            </BarChart>
          </ResponsiveContainer>
          <p className="text-xs text-muted-foreground">From the session's /cost. Opus is 83% of the cost. Nearly all tokens are cache reads: agents re-read their context on every turn.</p>
        </div>
      ) : (
        <div key="runs" className="jin space-y-2">
          <ResponsiveContainer width="100%" height={260}>
            <BarChart data={runs} margin={{ left: -10, bottom: 30 }}>
              <CartesianGrid strokeDasharray="3 3" vertical={false} />
              <XAxis dataKey="run" interval={0} angle={-40} textAnchor="end" tick={{ fontSize: 10 }} />
              <YAxis />
              <Tooltip />
              <Legend verticalAlign="top" />
              <Bar {...anim} dataKey="opus" name="Opus $" stackId="a" />
              <Bar {...anim} dataKey="sonnet" name="Sonnet $" stackId="a" radius={[4, 4, 0, 0]} />
            </BarChart>
          </ResponsiveContainer>
          <p className="text-xs text-muted-foreground">Estimated from each run's agent transcripts at public list prices. The device rounds and the desktop harness were the two most expensive runs. These runs are only part of the session: the orchestrator and 92 one-off subagents are not shown.</p>
        </div>
      )}
    </div>
  );
}
What the $585.52 covers, and what it doesn't

Covered: what /cost counted for the Claude Code session that ran the build.

Not covered: the 9 October planning session, the fix sessions after the merge (#1934 to #1939), CI minutes, and the owner's own time, which we'd most like to know and don't.

Why the transcripts show more. Before the owner sent the /cost figure, I estimated cost from the session's transcript files, pricing every recorded reply at public list prices. That gave about 1,034 for the whole session, of which about97 was ringtone and sound-design runs that didn't ship. The pricing agrees with /cost: the measured token counts priced the same way come out within about 2% of the measured dollars. The difference is scope. The transcripts run from 11 October 22:38 to 14 October 14:31, about 64 hours, while /cost reports 1 day 16 hours of wall time, and the transcripts hold more Opus output (about 7.2 M tokens) than /cost counted (3.8 M). So /cost did not count everything the session's transcripts record. I couldn't establish why from the files on disk, so treat $585.52 as the measured floor and the transcript figure as an unverified upper estimate.

Why the line counts differ. /cost reports 9,407 lines added and 935 removed. Git reports +26,847 / −161 for the merged stack. They count different things: /cost counts edits made through the session's tools while its counter ran, and git counts the net diff of the final merge. I can't break the gap down further from the evidence I have.

How the architecture came about

The architecture wasn't designed in one go. An agent proposed a plan, the owner changed its scope in one sentence, and then dozens of small steers shaped the code over three days. The interesting part is how each steer happened: the owner rarely gave a spec. He gave a direction, a comparison or a challenge, and the agents had to turn it into code.

The plan, and the first override

On 9 October the owner asked an agent what the server side already supported for calls, and how to plan the screens. The agent read the server's merged work (a live relay for small real-time messages, a STUN responder, ring and hang-up pushes) and wrote a plan in Journal. It proposed:

Two days later the owner's kickoff message overruled the last point: "Make sure to do it also for the desktop. We also support the desktop as well." The first harness step re-checked the libraries and found webrtc-java 0.19.0, updated in late September and more recently maintained than webrtc-kmp. That is why desktop got its own engine, WebRtcJavaCallEngine, next to the shared WebRtcKmpCallEngine, instead of waiting for v2. The state machine, the fakes and the Call lab stayed as planned; the Call lab survives in the developer menu.

Directions, comparisons and challenges

Most steers came as one line in the middle of a run. These are the ones that changed the code most.

const css = `
.jx{box-sizing:border-box;cursor:pointer;user-select:none;transition:background-color 180ms ease-out,border-color 180ms ease-out,color 180ms ease-out,transform 150ms ease-out}
.jx:hover{border-color:var(--ring)}
.jx:active{transform:scale(0.985)}
.jx:focus{outline:none}
.jx:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
@keyframes jin{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
.jin{animation:jin 200ms ease-out both}
@media (prefers-reduced-motion: reduce){.jx{transition:none}.jx:active{transform:none}.jin{animation:none}}
`;

function P({ on, active, className = '', children }) {
  return (
    <div
      role="button"
      tabIndex={0}
      aria-pressed={active}
      onClick={on}
      onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); on(); } }}
      className={'jx ' + className}
    >
      {children}
    </div>
  );
}

const steers = [
  {
    when: '12 Oct', topic: 'Desktop window',
    owner: '"For desktops, I would expect it opens up a new window. I still want to access my chats while I can be on a call. That\'s how Telegram, Signal, and WhatsApp does."',
    agent: 'Checked the code first: the call screen was drawn over the whole main window, so chats were blocked. It agreed, then wrote a separate harness that first listed what our desktop lacked against Telegram, Signal, WhatsApp and Meet.',
    result: 'A separate call window, a ring window, device switching from the title bar and a mini window (#1892).',
  },
  {
    when: '12 Oct', topic: 'The Redmi failures',
    owner: '"You can\'t blame the decoder, because Signal and WhatsApp also work flawlessly on this device."',
    agent: '"You\'re right, and I take that back." The logs showed incoming packets stopped at 526 and a keyframe request went unanswered: a sending and keyframe bug in our engine, not the phone.',
    result: 'A later, different symptom (a one-second delay) did trace to the decoder, but to a setting we controlled. See "What the agents thought vs what was true" below.',
  },
  {
    when: '13 Oct', topic: 'Video quality',
    owner: 'First "1080p till 480p", later: "I just gave an estimate. It should be adaptive. The maximum should be 1080p, but it can go as low as it wants." Then: "Low powered phones should target performance."',
    agent: 'Had taken "480p" as a hard floor. Removed it, then added a load rung that drops resolution when a phone cannot encode 30 fps.',
    result: 'No resolution floor, and a ladder that reacts to both the network and the device.',
  },
  {
    when: '13 Oct', topic: 'Proof before VP8',
    owner: '"Show me the proof that the iPhone encodes VP8 in software. It will cost too much battery. I\'m pretty sure there should be another good method."',
    agent: 'Quoted the libwebrtc source for our build: VP8 goes through libvpx on the CPU, H.264 through VideoToolbox hardware. Proposed an order: fix the Android decoder, cap at 720p, per-direction VP8 only as a last resort, HEVC later.',
    result: 'The decoder fix and the 720p cap were enough. No phone was switched to VP8; both keep hardware H.264.',
  },
  {
    when: '13 Oct', topic: 'Why not copy Signal?',
    owner: '"Signal uses a very optimized solution and it\'s been robust. So why aren\'t we following their approach, and why are we reinventing?"',
    agent: 'Conceded part of it: "we can\'t reuse Signal\'s code directly (AGPL, their own servers), but we can copy their decisions, and in several places we should have." Called our resolution ladder "our reinvention" and proposed testing stock libwebrtc adaptation against it.',
    result: 'Adopted the 720p cap Signal and Telegram share, and their video-call audio mode. The ladder test went the other way: on the phones it beat stock adaptation, so it stayed.',
  },
  {
    when: '14 Oct', topic: 'Answering a video call',
    owner: '"A video call should be answered with video only, and an audio call starts with audio but can be upgraded to video mid session."',
    agent: 'Removed "answer as voice". To add video without a second offer (which could collide with an ICE restart), every call now sets up an idle video transceiver at the start.',
    result: 'Upgrades work with no renegotiation. That idle transceiver is also what caused the post-merge crash in #1939.',
  },
];

export default function App() {
  const [i, setI] = useState(0);
  const s = steers[i];
  return (
    <div className="space-y-3">
      <style>{css}</style>
      <div className="flex flex-wrap gap-2">
        {steers.map((x, j) => (
          <P key={j} on={() => setI(j)} active={i === j} className={'rounded-full border px-3 py-1 text-xs ' + (i === j ? 'bg-primary text-primary-foreground' : 'bg-muted')}>{x.topic}</P>
        ))}
      </div>
      <div key={i} className="jin grid grid-cols-1 gap-2">
        <div className="rounded-lg border border-blue-500 bg-blue-50 p-3"><p className="text-xs text-muted-foreground">The owner, {s.when}</p><p className="text-sm">{s.owner}</p></div>
        <div className="rounded-lg bg-muted p-3"><p className="text-xs text-muted-foreground">What the agent did</p><p className="text-sm">{s.agent}</p></div>
        <div className="rounded-lg border border-green-500 bg-green-50 p-3"><p className="text-xs text-muted-foreground">What it changed in the code</p><p className="text-sm">{s.result}</p></div>
      </div>
    </div>
  );
}

"Which of my words did you take literally?"

On 13 October the owner asked the orchestrating agent exactly that. It answered with a table, "the first table is where I most want you to check me". A few rows:

What the agent decided

Based on

The Calls tab is visible by default, right after Chats

"calls should be in its own bottom navigation bar"

Mirroring applies only to your own preview, not to the video the other person gets, as FaceTime, WhatsApp and Meet do

"make sure the mirror mode is enabled… for all devices"

Incoming calls on iPhone in the foreground use our own screen; CallKit only when a push wakes the phone

The agent's own choice

Desktop voice calls can switch to video mid-call

Added by the final review agent, not asked for

A 480p resolution floor

"1080p till 480p", which the owner then corrected

It's the most useful question in the whole log. The agents made many small product decisions on their own, and most were reasonable. The owner only found out about them because he asked.

How the work was run

Nobody typed "build calling" and waited. The orchestrating session wrote workflow scripts: JavaScript files that start agents, collect what they return and decide what runs next. Tap a stage.

const css = `
.jx{box-sizing:border-box;cursor:pointer;user-select:none;transition:background-color 180ms ease-out,border-color 180ms ease-out,color 180ms ease-out,transform 150ms ease-out}
.jx:hover{border-color:var(--ring)}
.jx:active{transform:scale(0.985)}
.jx:focus{outline:none}
.jx:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
@keyframes jin{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
.jin{animation:jin 200ms ease-out both}
@media (prefers-reduced-motion: reduce){.jx{transition:none}.jx:active{transform:none}.jin{animation:none}}
`;

function P({ on, active, className = '', children }) {
  return (
    <div
      role="button"
      tabIndex={0}
      aria-pressed={active}
      onClick={on}
      onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); on(); } }}
      className={'jx ' + className}
    >
      {children}
    </div>
  );
}

const stages = [
  ['Plan', 'Opus', 'Splits the feature into slices with a written spec each.', 'A slice too big to review, or a plan that misses what the owner assumed (desktop, in this case).'],
  ['Build', 'Sonnet', 'Implements one slice in a worktree, runs one targeted Gradle build.', 'Code that compiles and passes its own tests but was never run for real.'],
  ['Review', 'Opus', 'Checks the diff against the slice spec, up to three rounds.', 'Reviews read code, not devices. The decoder wrapper that crashed the Redmi passed review.'],
  ['Checkpoint', 'Opus + Sonnet', 'A correctness review, then simplify, before the next slice starts. Design findings go to a stacked structure PR.', 'Added mid-project: before it, eight design problems surfaced only at the end.'],
  ['Polish', 'Opus', 'Iterates the call UI until a separate Opus judge scores the screenshots 9 of 10.', 'The judge sees still screenshots. Problems that only show in motion need a device.'],
  ['Device', 'Opus judges', 'Real calls between the Redmi, the iPhone and the Mac, with logs as evidence. Next round retests only what failed.', 'It always installed the debug build. This is where the release crashes slipped through.'],
  ['Final', 'Opus', 'Scores the whole branch; one fix round if it falls short.', 'A score is only as good as what was tested.'],
  ['PR', 'Haiku watches CI', 'Pushes and opens the PR. Never merges.', 'CI for 11 stacked PRs saturated the shared runners.'],
];

export default function App() {
  const [i, setI] = useState(5);
  const [name, model, did, risk] = stages[i];
  return (
    <div className="space-y-3">
      <style>{css}</style>
      <div className="flex flex-wrap items-center gap-1">
        {stages.map((s, j) => (
          <React.Fragment key={j}>
            <P on={() => setI(j)} active={i === j} className={'rounded-md border px-2 py-1 text-xs ' + (i === j ? 'bg-primary text-primary-foreground' : (j === 5 ? 'bg-red-50' : 'bg-muted'))}>{s[0]}</P>
            {j < stages.length - 1 && <span className="text-xs text-muted-foreground">›</span>}
          </React.Fragment>
        ))}
      </div>
      <div key={i} className="jin grid grid-cols-1 gap-2 sm:grid-cols-2">
        <div className="rounded-lg bg-muted p-3"><p className="text-xs text-muted-foreground">{name} · {model}</p><p className="text-sm">{did}</p></div>
        <div className="rounded-lg border border-red-500 bg-red-50 p-3"><p className="text-xs text-muted-foreground">What could go wrong</p><p className="text-sm">{risk}</p></div>
      </div>
    </div>
  );
}

Eight scripts touched calling: the core call-harness, desktop-call-harness, calls-tab, call-fix with overnight and morning variants, and two sound-design harnesses whose ringtones didn't ship. Overnight the orchestrator ran in a /loop, woke about once an hour, launched the next step of a written "night chain" and left a Journal report for the morning.

The rules the owner added along the way

Each was added after something went wrong. The agents saved them to project memory, and later harnesses read them.

Rule

Where it came from

Real devices are the source of truth; a simulator counts only where it is shown to match a phone

Day 1, when the owner offered the iOS simulator for UI checks and then drew the line

Retest only what failed

Day 1, when a device round re-screenshotted screens that had already passed

Review and simplify at every slice checkpoint

Day 2, after an end-of-run simplify found eight design problems

One Gradle build at a time per step; reviewers never build

Day 2, after the 16 GB Mac crashed for the third time

No screenshots in PRs

Day 2: they showed personal data

Only touch the debug app

An older rule, so agents never disturb the owner's own installed app. It matters below

What the agents thought vs what was true

Every reversal in the project followed the same pattern: an agent believed something, a measurement on a device said otherwise, and the agent changed course. Tap a card to flip it.

const css = `
.jx{display:block;box-sizing:border-box;cursor:pointer;user-select:none;transition:background-color 180ms ease-out,border-color 180ms ease-out,transform 150ms ease-out}
.jx:hover{border-color:var(--ring)}
.jx:active{transform:scale(0.985)}
.jx:focus{outline:none}
.jx:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
@keyframes jin{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
.jin{animation:jin 200ms ease-out both}
@media (prefers-reduced-motion: reduce){.jx{transition:none}.jx:active{transform:none}.jin{animation:none}}
`;

const cards = [
  ['Video quality', 'Cap at 1080p and let libwebrtc adapt.', 'libwebrtc\'s scaler reacts to quantiser values, not bitrate: the Redmi sent 1920x1080 over a 3G-class link. Ten attempts later: a 720p cap plus our own ladder, which on the phones stepped down in 6.5 s against about 25 s for stock adaptation.'],
  ['The one-second delay', 'The Redmi\'s decoder is just slow.', 'It was holding 6 to 19 frames, because a forced H.264 level gave it a 16-frame buffer. Two vendor low-latency keys and the 720p cap took decode from 204 to 645 ms per frame down to 19 to 22 ms.'],
  ['The Mac crash', 'Two Gradle builds at 7 GB each crashed the Mac.', 'The memory report said the app itself held 19.6 GB. A 20-second soak test reproduced a leak of 90 MB a second: webrtc-java frames were never released.'],
  ['The decoder wrapper', 'It has unit tests and passed review, so it works.', 'It crashed the Redmi in the first real video call: libwebrtc\'s JNI passes a null the Kotlin code declared impossible, and the test\'s fake never did.'],
  ['Missed camera flips', 'Flipping the iPhone camera sometimes misses its 720p format.', 'A log line showed every flip picked 720p. The "misses" were taps that only brought back the hidden control bar.'],
  ['The merge', 'Git would flag a conflict if two branches disagreed.', 'One branch removed the resolution ladder, another restored it, and git applied the removal with no conflict. A review agent caught it, and the PRs were rebuilt as one linear stack.'],
];

function press(fn) {
  return {
    role: 'button',
    tabIndex: 0,
    onClick: fn,
    onKeyDown: (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); fn(); } },
  };
}

export default function App() {
  const [flipped, setFlipped] = useState({});
  return (
    <div>
      <style>{css}</style>
      <div style={{ display: 'grid', gap: '0.5rem', gridTemplateColumns: 'repeat(auto-fit, minmax(min(100%, 260px), 1fr))' }}>
        {cards.map(([title, thought, truth], i) => {
          const f = !!flipped[i];
          return (
            <div
              key={i}
              {...press(() => setFlipped({ ...flipped, [i]: !f }))}
              aria-pressed={f}
              className={'jx rounded-lg border p-3 ' + (f ? 'border-green-500 bg-green-50' : 'bg-muted')}
            >
              <p className="text-xs text-muted-foreground">{title}</p>
              <div key={f ? 'true' : 'thought'} className="jin">
                <p className="mt-1 text-xs font-medium">{f ? 'What was true' : 'What the agent thought'}</p>
                <p className="mt-1 text-sm break-words">{f ? truth : thought}</p>
              </div>
              <p className="mt-2 text-xs text-muted-foreground">{f ? 'Tap to see what the agent thought' : 'Tap to see what was true'}</p>
            </div>
          );
        })}
      </div>
    </div>
  );
}

Where self-verification failed

Within two hours of the merge, people installing the real builds hit four problems that three days of device passes had missed. Switch between the build the agents tested and the build users got.

const css = `
.jx{box-sizing:border-box;cursor:pointer;user-select:none;transition:background-color 180ms ease-out,border-color 180ms ease-out,color 180ms ease-out,transform 150ms ease-out}
.jx:hover{border-color:var(--ring)}
.jx:active{transform:scale(0.985)}
.jx:focus{outline:none}
.jx:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
@keyframes jin{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
.jin{animation:jin 200ms ease-out both}
@media (prefers-reduced-motion: reduce){.jx{transition:none}.jx:active{transform:none}.jin{animation:none}}
`;

function P({ on, active, className = '', children }) {
  return (
    <div
      role="button"
      tabIndex={0}
      aria-pressed={active}
      onClick={on}
      onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); on(); } }}
      className={'jx ' + className}
    >
      {children}
    </div>
  );
}

const rows = [
  {
    issue: 'Release APK aborts on the first call',
    debug: 'installDebug: not minified, every org.webrtc class present. Calls worked in every device pass.',
    shipped: 'R8 minifies the release build and strips org.webrtc classes that native code looks up by name. "Check failed: !clazz.is_null() org/webrtc/WebRtcClassLoader".',
    fix: 'One keep rule (#1936)',
  },
  {
    issue: 'Voice caller crashes when the callee answers',
    debug: 'Both phones always ran the same commit, so the caller and callee code always matched.',
    shipped: 'Mixed versions met. Android\'s getTransceivers() disposes senders it returned before, and the engine had cached one: "RtpSender has been disposed".',
    fix: 'Read the sender again after each remote description (#1939)',
  },
  {
    issue: 'Desktop can\'t load WebRTC',
    debug: 'desktopApp:run from Gradle: webrtc-java loads its native library from inside its jar.',
    shipped: 'The Conveyor-packaged app extracts native libraries from jars, and webrtc-java can\'t find it. The call then sticks on "Calling…".',
    fix: 'In progress',
  },
  {
    issue: 'Desktop crashes at a call window, then at launch',
    debug: 'The call-window test provided the missing dependency itself, so it passed.',
    shipped: 'The real call window sits outside the component that provides it. "CallPermissionGate is provided by CallHost".',
    fix: '#1934, then #1935',
  },
];

export default function App() {
  const [mode, setMode] = useState('debug');
  return (
    <div className="space-y-3">
      <style>{css}</style>
      <div className="flex flex-wrap gap-2">
        {[['debug', 'What the agents tested'], ['shipped', 'What users got']].map(([k, l]) => (
          <P key={k} on={() => setMode(k)} active={mode === k} className={'rounded-full border px-3 py-1 text-xs ' + (mode === k ? 'bg-primary text-primary-foreground' : 'bg-muted')}>{l}</P>
        ))}
      </div>
      <div key={mode} className="jin space-y-2">
        {rows.map((r, i) => (
          <div key={i} className={'rounded-lg border p-3 ' + (mode === 'debug' ? 'border-green-500 bg-green-50' : 'border-red-500 bg-red-50')}>
            <p className="text-sm font-medium">{r.issue}</p>
            <p className="mt-1 text-sm">{mode === 'debug' ? r.debug : r.shipped}</p>
            {mode === 'shipped' && <p className="mt-1 text-xs text-muted-foreground">Fix: {r.fix}</p>}
          </div>
        ))}
      </div>
    </div>
  );
}
The details behind each failure

What changes, and what agents still can't own

The other half of the record matters too. The agents caught a silent deletion in review, found a 19.6 GB leak behind a misleading crash report, rewrote their own fix after it crashed, and took back a wrong diagnosis the moment the owner challenged it. The rules that steer them now were each added after a specific mistake. Nobody wrote "test the build users install" until it broke.

Known limits


See More (10 posts)