Primers · Agents in production

The App That Heals Itself

A phone unlocks, the Shopify admin app returns to the foreground, and 130 milliseconds later it is dead, killed by a race in its own token code. In the old world that crash becomes a ticket and waits for a human morning. In the one Mustafa Ali announced on October 19, 2026, an agent has already reproduced it, fixed it, proven the fix, and cut a 52-second video explaining all three.

Researched October 2026  ·  AIEngineering
A phone on a night workbench while a small robotic arm stitches its cracked screen shut with red thread under a crescent moon

The brief

“We’re making Shopify’s mobile apps self-healing. Agents watch production 24x7 for new crashes, reproduce them, write and verify a fix, then generate a short video explaining the root cause and the fix. An engineer then just reviews and ships it.”

Mustafa Ali, Director of Engineering and Head of Mobile, Shopify · X, October 19, 2026

Think of it as a night-shift mechanic for software. The mechanic hears every new rattle the fleet brings in, replays it in the shop until it rattles the same way, fixes the cause, stress-tests the repair, and leaves a short video on the counter. The day engineer watches the video and decides: ship it, or send it back.

The crash stops being a ticket and becomes a shift: agents run detection to fix to proof, and the human keeps only the ship decision.

The analogy is the shape; the real system is stricter. The mechanic’s replay has to match the production failure frame for frame, the fix in the demo is three lines, and the proof is a 20,000-round stress test plus the app itself, run end to end. The worked example below traces the one crash Shopify showed, exactly as their video presents it.

Sourcing, up front

The loop itself is Shopify’s own account: one post and one demo video, with no outside audit and no published fix rates. What can be checked independently, Shopify’s migration numbers, the older automated-repair record, and a rival product doing the same loop, is checked below and cited. Where Shopify has published nothing, this page says so instead of estimating.

The sentence to rememberA production crash is no longer a ticket waiting for morning: an agent runs the whole night shift, detection to fix to proof, and the engineer’s job shrinks to a single decision, ship it or not.

One crash, end to end

This trace is Shopify’s own demo video, transcribed and quoted. It documents the pipeline as Shopify presents it; nobody outside Shopify can audit the incident. Every number in it is the video’s.

Issue #ABLS-11206, through the loop

One tap per step.

The loop earns trust the way a careful hire does: every step leaves evidence the next step can check.

How it works

No single mechanism here is new; the news is the closed loop, running all night with no human in the middle.

EXC_BREAKPOINT EXC_BREAKPOINT EXC_BREAKPOINT one issue one fingerprint

Every phone that crashes sends a report: the exception, the stack trace, the device, the app version. A grouping service computes a fingerprint from the stack and files every matching report under one issue, which is how crash tools like Sentry have worked for years.

Grouping is what makes the rest of the loop affordable. The agent never faces ten thousand reports; it faces the issues, ranked by how many users each one is hurting. Shopify has not named the reporter or grouping stack it uses, so this page describes the standard mechanism, not their vendor.

In the demo, the fingerprint is the trap inside schedulePrefetch: every phone that hits the race lands in the same issue, so one fix closes all of them.

production AsyncTask +432 destroyTask +20 _swift_release +64 schedulePrefetch = remote Mac AsyncTask +432 destroyTask +20 _swift_release +64 schedulePrefetch
offset +0x1B0 · match offset +0x14 · match offset +0x40 · match

Before any fix, the agent rebuilds the failure on a machine it controls, a remote Mac or a cloud simulator, against the merge base, the code as it currently stands. The reproduced crash has to match production frame for frame, down to the offsets in the stack.

The match is the whole point. A different stack means a different bug, and a fix written against the wrong reproduction is worse than none. Expo’s version of this loop states the rule plainly: if the agent cannot reproduce the bug, it reports what it tried and stops.

The demo’s reproduction is a stress test that forces the race on demand, because a race that fires once in a million resumes will not pose for a debugger.

OAuthTokenManager actor prefetchTask = Task { ... } Finishing prefetch task prefetchTask = nil Same Task released twice freed while running

The stack names the room, not the culprit: the blame frame is a closure inside schedulePrefetch. Reading the code around it, the agent finds the shape above. An actor, Swift’s unit of isolated state, keeps its scheduled token prefetch in a shared field that two paths can write.

On resume, a due prefetch and an app request finish the same token refresh together. Both replace the field at once, so both release the same underlying task, and the runtime frees a task that is still running. That double release is the trap the phones reported.

The video’s own summary is the whole diagnosis in six words: two writers, one unguarded field.

+ lock.lock(); defer { lock.unlock() } + generation &+= 1 + guard generation == finishedGeneration else { return }

The patch is the smallest change that removes the cause. The lock means only one writer touches the field at a time. The generation check means a finishing task may clear the field only if nobody newer has replaced it; a stale finisher returns without touching anything.

Machine-written fixes used to come from templates: Facebook’s Getafix, in 2019, learned fix patterns from past human fixes and ranked them. The 2026 agent writes the patch itself, but the shape that survives review is the same as it was then: tiny, local, and easy for a human to judge.

Nothing else in the file changes. The prefetch still prefetches; the fix only decides whose write counts.

Two patches stop this crash. Only one of them fixes it. Tap each one.

The crash test passes either way. The difference is what else each patch quietly does.

The trap in judging patches is old and measured. In 2015, Smith and co-authors evaluated repair tools against tests the tools had not been graded on, and found patches that passed their grading tests while breaking untested behavior; for healthy programs the tools were as likely to break tests as to fix them. The field calls it overfitting.

So the demo’s proof does not stop at the test suite. It re-runs the reproduction until it is boring, checks the race with a dedicated tool, and then runs the app itself through the exact path that used to kill it.

Stress test · 20,000 rounds clean Thread Sanitizer · no data race Simulator · resume round trip survives Android · same guard applied
The usual way

A crash report and a fix description: stack trace, thread dump, device logs, prose. Ali calls it the usual wall of text.

The agent’s way
The explainer video0:52 · cause, fix, proof

The same evidence, watchable in under a minute: the cause drawn, the reproduction matched, the diff, the stress test, the app surviving.

The video is not decoration; it is the review interface. An agent can produce fixes faster than any human can read reports, so the artifact the human judges has to compress. Expo’s loop makes the same bet, attaching before and after simulator recordings to every pull request it opens.

You are reading about one of these videos. The demo at the top of this story is the artifact itself: 52 seconds, start to finish.

Why now: the economics flipped

Agents did not get trusted with production crashes; they got cheap, and the gates around them got cheaper than the debugging they replace.

Two curves crossed. The first is the crash surface itself: Shopify spent 2025 and 2026 moving its apps from React Native back to native code, and published the stability table. The second is agent labor cheap enough to do the migration, and then to patrol what the migration produced.

Crashing sessions, before and after the native rebuild
React Native app0.5% of sessions crash
Per 100,000 sessions: 500 end in a crash.
Native app0.05% of sessions crash
Per 100,000 sessions: 50 end in a crash. A factor of 10 fewer.
The last 1% of sessions, magnifiedthis window is 1% wide
React Nativecrashes fill 50% of the window
Nativecrashes fill 5% of the window
Session stability went from 99.5% to 99.95% in Shopify’s published migration table.

The native sliver on the main bar is drawn at a 2-pixel floor so it stays visible; at true scale it would be a fifth of a pixel wide.

The migration itself is the tell. Ali’s September 2026 account says agents could “do enough of the implementation, translation, testing, and review work” that maintaining two native codebases stopped being the deciding cost. The rebuild was run as a checkpointed pipeline called Helix.

Each Helix checkpoint, in Ali’s description, “must prove its behavior with tests, match the running app in a visual review, survive two adversarial code reviewers, and get a human’s nod before it’s committed.” His rule for failures: “an imperfect attempt simply cannot move forward until it becomes a good result.”

The crash loop is that same gate stack, pointed at production instead of a migration. Watch, reproduce, fix, prove, human nod: the checkpoints did not change, only the input did. A crash report is a checkpoint failure that arrives on its own schedule.

What Shopify has not published

No fix rate, no share of crashes the agents close, no review acceptance rate, and no time saved for this loop appears in the post, the video, or Shopify’s engineering blog as of October 2026. Those numbers would settle the economics; until they exist, the honest claim is narrower: the loop runs, and one run is on video.

The long arc

Machines have proposed fixes since 2018; what changed is the proposer can now reproduce the bug, reason about it, and show its work.

Automated repair, 2015 to 2026
2015 · The warning first

Patches that pass can still be wrong

Smith, Barr, Le Goues, and Brun evaluate automated repair tools on 998 bugs against tests the tools never saw. Many accepted patches break behavior the grading tests miss, and on healthy programs the tools are about as likely to break a test as to fix one. The field names the failure mode: overfitting.

998 bugs · the overfitting result every repair system since has had to answer
September 2018 · Facebook

SapFix proposes, engineers approve

Facebook announces SapFix: when a crash is reported, the system generates candidate fixes by reverting, templating, or mutating code, tests each one end to end, and proposes the survivor to an engineer. The paper calls it the first machine-generated fix with automated end-to-end testing deployed at Facebook’s scale.

2018 · the propose-and-approve shape is set, eight years before Shopify’s post
November 2019 · Facebook

Getafix learns from human fixes

Getafix mines thousands of past human-written fixes for recurring patterns, then ranks new candidate patches by how well they match what engineers actually did before. It runs beside static analysis at Facebook, turning yesterday’s repairs into today’s suggestions.

Pattern mining · fixes proposed in the shape of fixes humans already shipped
July 2025 · The measurement

Experienced developers, 19% slower with AI

METR runs a randomized controlled trial: 16 experienced open-source developers, 246 tasks in repositories they know deeply. With AI tools allowed, tasks take 19% longer. The developers had forecast a 24% speedup, and afterward still believed they had been about 20% faster.

+19% time · measured, against a believed speedup of about 20%
September 10, 2026 · Shopify

Native again, built by agents behind gates

Shopify announces the move back to native mobile, with agents doing implementation, translation, testing, and review inside Helix checkpoints: tests, a visual review against the running app, two adversarial reviewers, and a human nod. The Shop app’s rebuild took 12 weeks and 6 engineers; crashing sessions fell tenfold.

0.5% to 0.05% · crashing sessions across the migration
September 22, 2026 · Expo

The same loop, sold as a product

Expo ships the loop for its own customers: label a GitHub issue for reproduction and Claude Code takes it onto a cloud simulator, reproduces the bug, fixes it, re-runs it, and opens a pull request with before and after recordings. If it cannot reproduce the bug, it reports that and stops. Merging stays with a person.

22 of 22 · Settings tests passing in Expo’s published worked example
October 14, 2026 · The audit

Shopify’s four gates, rebuilt and priced

An independent developer rebuilds the Helix gate stack in Claude Code and runs it 50 times against 25 hidden requirements. Acceptance tests written by a separate agent lift passing runs from 70% to 84%. Two reviewer agents alone add nothing, and the full stack costs about ten dollars in API spend across the whole matrix.

84% with tests · 68% with reviewer agents alone, at three times the cost
October 19, 2026 · The post

The loop closes in production

Ali announces self-healing apps: agents watch production around the clock, reproduce each new crash, write and verify a fix, and cut a short explainer video. The demo follows one crash from trap to a three-line fix to a 20,000-round stress test. The engineer’s remaining job is the review and the ship decision.

52 seconds · the whole incident, as a video an engineer can judge

Swipe, tap the arrows, or use the arrow keys.

Key voices

Everyone serious keeps a human on the ship decision; the live argument is how much machine evidence that human can trust.

Mustafa Ali
Director of Engineering and Head of Mobile, Shopify · the builder
Runs the loop

Ali’s claim is operational, not futuristic: the watch, reproduce, fix, and verify steps already run, and the explainer video is what makes the human step cheap enough to keep. His migration writing sets the terms: an attempt that fails a gate “simply cannot move forward until it becomes a good result,” and the loop “gets more autonomous as the migration progresses.”

Shopify Engineering: Native is now the future of mobile at Shopify
Mark Harman
SapFix co-author, Meta and University College London · the original designer
Propose and approve, since 2018

Harman’s team shipped machine-proposed fixes at Facebook in 2018 with the human approval step designed in from the start, not added as a concession. His stated measure of the whole enterprise is modest and durable: “It’s saving developers time, that’s our key goal.” Eight years on, Shopify’s loop keeps exactly that shape, with better evidence attached.

IEEE Spectrum: Meet the bots that review and write snippets of Facebook’s code
METR
Independent AI evaluation nonprofit · the measurement dissent
Measure outcomes, not demos

METR’s randomized trial is the standing rebuke to demo-driven confidence: experienced developers using AI tools finished 19% slower while believing they had been about 20% faster. Applied here, the dissent is precise: a flawless 52-second video proves the loop can run once, beautifully. It says nothing about the average crash, the rejected fixes, or the review minutes actually saved.

METR: Measuring the impact of early-2025 AI on experienced developers

The disagreement is real but narrow. Ali and Harman agree on the shape and differ on the evidence standard: Harman’s bar was time saved, Ali’s artifact is built to be judged at a glance. METR’s point is that glances are exactly what mislead, and only published outcome numbers, which Shopify has not released, would settle it.

Where leaders think this goes

Generation is solved enough to argue about; the open fight is which verification gate actually earns its cost.

Positions as of October 2026. Every camp names its people.

Where they agree
The human keeps the ship decision
Three independent systems, built eight years apart, land on the same line: the machine proposes, a person disposes. SapFix sent fixes to engineers for approval in 2018. Expo’s product stops at the pull request and leaves merging to a person. Ali’s post ends the pipeline at review and ship. Autonomy expands everywhere except the last step.
Mustafa Ali (Shopify) · the Expo team · the SapFix team (Meta)
Where they agree
The review artifact becomes evidence, not prose
Both 2026 loops replace the written report with something watchable. Shopify generates a short video walking through cause, fix, and proof. Expo attaches before and after simulator recordings to its pull requests. The bet is shared: review time is the scarce resource, so the artifact is engineered to be judged in a minute.
Shopify · Expo
Where they split
Which gate earns its cost

Side A: layer the gates. Shopify’s Helix stack runs tests, a visual review, two adversarial code reviewers, and a human nod, on the theory that each gate catches a different failure class and an attempt that fails any of them simply does not move forward.

Side B: only the tests paid off. The October 2026 replication of those gates found acceptance tests written by a separate agent doing nearly all the work, reviewer agents adding nothing at three times the cost. METR’s standing advice cuts the same way: judge the stack by measured outcomes, not by how thorough it looks.

Side A: Shopify (Helix) · Side B: the gate replication’s author · METR
The long shot
The gates themselves get automated away
Ali writes that the Helix loop “gets more autonomous as the migration progresses.” Read literally, today’s human checkpoints are scaffolding: as the evidence gets stronger, gates merge, lighten, or drop. This is one company’s stated direction for its own pipeline, not a consensus, and nobody has published the acceptance data that would justify the next gate coming off.
Shopify only · stated direction, October 2026

Takeaways

Copy the loop, not the headline: watch, reproduce, fix small, prove it twice, show the video, keep the human on ship.

Shopify’s loop is real enough to watch end to end: one crash, reproduced, fixed in three lines, proven 20,000 times, explained in 52 seconds. What transfers is the design, not the headline: reproduction as the gate, small patches, proof an engineer can inspect, and a human holding the ship decision. What the loop earns, crashes fixed per week, hours saved, fixes rejected, Shopify has not published, and no outsider can audit yet.

Keep exploring

Sources

  1. Mustafa Ali, X post, October 19, 2026. x.com/mustafa01ali
  2. Mustafa Ali, “Native is now the future of mobile at Shopify,” Shopify Engineering, September 10, 2026. shopify.engineering/back-to-native
  3. Andre Da Silva, Kevin Kim, and Javier Fagoaga, “Migrating Shop app from React Native to native,” Shopify Engineering, September 10, 2026. shopify.engineering/shop-app-migration
  4. Expo, “What if your app could fix itself?,” September 2026. expo.dev/blog/agent-fixes-bugs-on-eas-simulator
  5. Alexandru Marginean and others, “SapFix: Automated End-to-End Repair at Scale,” ICSE-SEIP 2019. doi.org/10.1109/ICSE-SEIP.2019.00011
  6. Johannes Bader and others, “Getafix: Learning to Fix Bugs Automatically,” OOPSLA 2019. arxiv.org/abs/1902.06111
  7. Edward K. Smith, Earl T. Barr, Claire Le Goues, and Yuriy Brun, “Is the Cure Worse than the Disease? Overfitting in Automated Program Repair,” ESEC/FSE 2015. squareslab.github.io (PDF)
  8. METR, “Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivity,” July 10, 2025. metr.org
  9. Sentry documentation, issue grouping and fingerprint rules. docs.sentry.io
  10. “Shopify’s four gates, rebuilt in Claude Code: only the tests paid off,” dev.to, October 14, 2026. dev.to/aidiveyt
  11. “Meet the bots that review and write snippets of Facebook’s code,” IEEE Spectrum. spectrum.ieee.org

Shopify’s crash loop, its demo crash, and every number inside the video (130 ms, the matching offsets, 20,000 rounds) are Shopify’s own account, from one post and one video, with no outside audit. The migration numbers, the Expo loop, the repair research, the METR trial, and the gate replication are independently checkable at the sources above. Shopify’s crash reporter and the models running its agents are not named in anything it has published, so this page does not name them either.