Known bugs, replayed
A demo we write ourselves is easy to suspect because we picked the bug, wrote the test and knew the answer ahead of time. A replay takes a closed issue from a public project, checks the repository out at the commit right before the maintainers' fix, adds the regression test from the fix commit, and gives Mercury CLI one prompt. Here the bug, the test and the fix all belong to someone else. Everything below is what happened across three replays in Flask, Fastify and axios, including the failed tool calls, what the short clips cut, and the commands to run each one yourself.
The rules of a replay
- Closed issue and merged fix: each target is a closed bug with a merged fix commit from the project's maintainers.
- Project test, red then green: each uses a test from the project's own suite that fails on the fix's parent commit and passes on the fix commit.
- Working copy without later history: for the two later replays (Fastify and axios), the working copy was made without
.gitand given a fresh single-commit repository, verified with an emptygit fsck --lost-found, so the fix commit was not in it. We closed that door after the Flask replay, whose working copy was a full copy of the shallow clone,.gitincluded, checked out at the parent commit (detailed in the Flask section below). - One prompt, one build: each run received one prompt, typed once, in Mercury 1.1.1 running the model and effort shown on screen in each clip.
- How the clips are made: each clip is rendered from the terminal output recorded during the accepted take. Every frame is a screen the terminal painted; the time between frames is changed. Typing is sped up, and the debugger stops, the diff and the test results are slowed or held so they can be read. Each section below lists what its clip cuts.
- Every take accounted for:
- Flask #5786 (4 takes; Take 4 accepted): Take 1 fixed the bug and passed
tests/test_testing.py25/25, finishing in 75 s, but ran in a temporary folder whose full path, a local username included, showed in theDebugstack frames. Takes 2 and 3 also fixed the bug and passed 25/25, then investigated an unrelated pre-existingtests/test_reqctx.pyfailure and stopped on a permission card for aPYTHONPATH=command (in Take 2, compactBashoutput also hid the pytest results; Take 3 also hit a temp-directory delete guard). Take 4 finished in 71 s with full tool output shown. - Fastify #6674 (5 takes; Take 5 accepted): Takes 1 and 3 fixed
lib/route.jsand passedtest/throw.test.js19/19, then waited on a permission card after running unquoted globs inBash(test/route*.test.jsin Take 1,grep ... --include=*.jsin Take 3). Take 2 stopped on the same unquoted-globgreppermission card before editing. Take 4 made zero model calls because a colon rule (Bash(npm:*)) triggered a settings warning before boot; changing it toBash(npm *)cleared Take 5, which finished in 59.2 s with zero permission cards. - axios #7365 (1 take; Take 1 accepted): finished in 53.8 s on the first take.
- Flask #5786 (4 takes; Take 4 accepted): Take 1 fixed the bug and passed
Flask #5786
Inside with client:, calling client.get("/redirect", follow_redirects=True) when /redirect sets flask.session["redirect"] = True and /target sets flask.session["target"] = True kept flask.session["redirect"], then raised KeyError: 'target' at src/flask/sessions.py:86 with self = <SecureCookieSession {'redirect': True}>. The bug was reported by a Flask user in pallets/flask#5786 and fixed by the Pallets maintainers in PR #5797 (fix commit 24824ff666e096c4c07d0b75a889088571afe4a6, parent commit 5addaf833b2e8c7a616f89dd8ad5a44b07d7c000).
Unlike the Fastify and axios runs, the Flask working copy was a full copy of the shallow clone checked out at 5addaf83 with tests/test_testing.py from 24824ff6 staged, .git included. The fix commit was in that copy's object store, reachable through FETCH_HEAD and the HEAD reflog though not from HEAD or any branch. The take's session transcript records every tool call. Its git commands were git status, git diff --cached and git diff at the start, git diff HEAD --stat while reading src/flask/testing.py, and git status, git diff, git apply -R and git apply at the end to confirm an unrelated failure. None of them reads history: the record has no git log, git show, git reflog or FETCH_HEAD. The agent found the cause through two debugger stops in src/flask/testing.py.
Prompt:
test_redirect_session fails. Find out why with the debugger and fix the cause.
What the debugger showed
Mercury launched pytest under debugpy and stopped at src/flask/testing.py:243 inside FlaskClient.open(). A Debug evaluate over self._new_contexts returned all four preserved contexts in order:
[(0, 'AppContext', None, None), (1, 'RequestContext', '/redirect', {'redirect': True}), (2, 'AppContext', None, None), (3, 'RequestContext', '/target', {'redirect': True, 'target': True})]
The agent then placed a breakpoint at src/flask/testing.py:247 (right after the re-push loop), continued to :247, and evaluated the active request context (_cv_request.get()), reading:
('/target', '/redirect', {'redirect': True}, 0)
Although open() had just handled '/target', the while self._new_contexts: cm = self._new_contexts.pop() loop popped contexts in reverse order, pushing '/target' first and '/redirect' on top of it.
Maintainers' diff vs Mercury's diff
Maintainers' fix (src/flask/testing.py):
- while self._new_contexts:
- cm = self._new_contexts.pop()
+ for cm in self._new_contexts:
self._context_stack.enter_context(cm)
+ self._new_contexts.clear()
return response
Mercury's diff (Take 4, src/flask/testing.py):
- while self._new_contexts:
- cm = self._new_contexts.pop()
+ # Push in the order they were preserved so that the context of
+ # the last request, after following redirects, ends up on top.
+ for cm in self._new_contexts:
self._context_stack.enter_context(cm)
+ self._new_contexts.clear()
+
return response
The two code lines match the maintainers' fix; Mercury also added a two-line comment above the loop and a blank line after self._new_contexts.clear().
Verification and media
After the edit, the agent ran pytest tests/test_testing.py -k test_redirect_session -q (1 passed, 24 deselected in 0.02s) and the full suite (1 failed, 475 passed, 6 skipped). The one failure was pre-existing tests/test_reqctx.py::test_bad_environ_raises_bad_request (Werkzeug 3.1.9 against Flask 3.1.2), which the agent confirmed failed the same way with its edit temporarily reverted. After the take, the recording script ran pytest tests/test_testing.py -q on the same copy: 25 passed.

Watch the Flask #5786 replay clip (32 s, MP4)
What the clip leaves out
The run took 71 s; the clip is 32 s, opens on the settled home screen, and has four cuts:
- 12.03 s cut: model thinking and reading
src/flask/testing.py. - 7.16 s cut: a first
Debug evaluatecomprehension that hitAttributeError: 'AppContext' object has no attribute 'request'before the agent rewrote the expression, plus actx.pysearch. - 5.95 s cut:
Readofsrc/flask/testing.pybefore the edit. - 11.09 s cut: checking the unrelated pre-existing
tests/test_reqctx.pyfailure.
Between the cuts the footage runs at 0.45 to 1.5 times the recorded speed, and the last screen is held for 4 s. One row of the side rail, a usage meter, is blanked for the whole clip.
Run it yourself
pytest<9 is needed because Flask 3.1.2's tests/conftest.py references _pytest.monkeypatch.notset, removed in pytest 9.
mkdir -p flask-replay && cd flask-replay
git init && git remote add origin https://github.com/pallets/flask.git
git fetch --depth=2 origin 24824ff666e096c4c07d0b75a889088571afe4a6
git checkout 5addaf833b2e8c7a616f89dd8ad5a44b07d7c000
uv venv .venv --python python3
uv pip install --python .venv/bin/python -e . "pytest<9"
git checkout 24824ff666e096c4c07d0b75a889088571afe4a6 -- tests/test_testing.py
.venv/bin/pytest tests/test_testing.py -k test_redirect_session
The recorded take ran in a copy of the tree prepared this way, .git included.
Then run mercury in flask-replay and enter:
test_redirect_session fails. Find out why with the debugger and fix the cause.
Fastify #6674
Registering a duplicate route whose method is an array such as ['GET', 'POST'] threw an uncoded error from find-my-way (error.code === undefined) instead of Fastify's FST_ERR_DUPLICATED_ROUTE. Opened by Nikita Skovoroda (@ChALkeR) in fastify/fastify#6674 and closed on 19 April 2026 by PR #6678 (fix commit d9659819fbbc391d054f1aa4b49ce969a13610dd, parent commit c2ba18c17769dacce61472ec0397560b3b4eebde), written by Matteo Collina (@mcollina) and merged by KaKa Ng (@climba03003), Lead Maintainers of Fastify.
Prompt:
The test "Fastify should throw on multiple assignment to the same route with array method" in test/throw.test.js fails. Find out why with the debugger and fix the cause.
What the debugger showed
Mercury launched test/throw.test.js under js-debug with a breakpoint at lib/route.js:368 inside addNewRoute. Its --test-name-pattern=array method argument did not filter the run, so Hit 1 stopped on a single-method 'GET' sibling test. After continue, Hit 2 stopped on the second fastify.route({ method: ['GET', 'POST'], ... }) call, where Debug evaluate returned:
{
"method": ["GET", "POST"],
"url": "/",
"errMsg": "Method 'GET' already declared for route '/' with constraints '{}'",
"errName": "Error",
"needle": "Method 'GET,POST' already declared for route",
"includes": false,
"byFastify": false
}
With error.code equal to undefined, interpolating the array into the template literal produced 'GET,POST', which never matched find-my-way's single-method message, so Fastify rethrew the plain router error.
Maintainers' diff vs Mercury's diff
Maintainers' fix (lib/route.js, Matteo Collina):
- const isDuplicatedRoute = error.message.includes(`Method '${opts.method}' already declared for route`)
+ const methods = Array.isArray(opts.method) ? opts.method : [opts.method]
+ const isDuplicatedRoute = methods.some(method => error.message.includes(`Method '${method}' already declared for route`))
Mercury's diff (Take 5, lib/route.js):
- const isDuplicatedRoute = error.message.includes(`Method '${opts.method}' already declared for route`)
+ // find-my-way reports the single method that collided, so an array
+ // of methods has to be checked one by one
+ const methods = Array.isArray(opts.method) ? opts.method : [opts.method]
+ const isDuplicatedRoute = methods.some(method => error.message.includes(`Method '${method}' already declared for route`))
The two code lines match the maintainers' fix line for line; Mercury also added two comment lines above them.
Verification and media
After the edit, node --test test/throw.test.js passed (pass 19, fail 0), the route-related test files passed (pass 206, fail 0), and npx eslint lib/route.js exited clean. The agent did not run the full suite. When the replay was prepared, the full npx borp suite with the [email protected] pin gave pass 2212, fail 1 at the parent commit with the fix's test and pass 2213, fail 0 at the maintainers' fix.

Watch the Fastify #6674 replay clip (30 s, MP4)
What the clip leaves out
The run took 59.2 s; the clip is 30 s, opens as the prompt finishes typing, and has four cuts:
- Cut 1: initial
Grepbefore the failing test output. - Cut 2: thinking wait and a
Debug breakpointscall made before any debug session existed, which appears on screen as an error row. - Cut 3: pre-diff editing spinner.
- Cut 4: pre-final repaint frames.
Between the cuts the footage is retimed as described in the rules above, and the last screen is held for 4.5 s.
Run it yourself
Fastify commits no lockfile, so an install on 28 November 2026 pulled light-my-request 6.8.1, which returns an empty payload on a HEAD injection and fails two unrelated tests in the full suite (test/internals/all.test.js:6 and test/constrained-routes.test.js:609). Pinning [email protected] (the newest release on the parent commit's date) keeps the full suite failing only on the target test.
mkdir -p fastify-replay && cd fastify-replay
git init -q && git remote add origin https://github.com/fastify/fastify.git
git fetch -q --depth 2 origin d9659819fbbc391d054f1aa4b49ce969a13610dd
git checkout -q c2ba18c17769dacce61472ec0397560b3b4eebde
npm install --no-audit --no-fund --no-package-lock
npm install light-my-request@6.6.0 --no-save --no-package-lock --no-audit --no-fund
git checkout d9659819fbbc391d054f1aa4b49ce969a13610dd -- test/throw.test.js
node --test test/throw.test.js
The recorded take ran in a copy of the tree prepared this way, made without .git and committed once into a new repository.
Then run mercury in fastify-replay and enter:
The test "Fastify should throw on multiple assignment to the same route with array method" in test/throw.test.js fails. Find out why with the debugger and fix the cause.
axios #7365
Passing three or more repeated keys through formDataToJSON wrapped the existing array inside another array ([["301","302"],"303"]) instead of keeping the values flat (["301","302","303"]). Opened by @startjava in axios/axios#7365 and closed on 9 April 2026 by PR #10676 (fix commit 0912bde937c9505ce5464d5b9c56b81d1edeab63, parent commit 8b68491d04838aaab5d1a4d30e23d1f534beceeb), written and merged by Jay (@jasonsaayman, axios contributor).
Prompt:
The test "should keep repeatable values flat for 3+ entries" in tests/unit/helpers/formDataToJSON.test.js fails. Find out why with the debugger and fix the cause.
What the debugger showed
Mercury launched Vitest (--project unit, --no-file-parallelism, --pool=threads, --testTimeout=0) under js-debug with a breakpoint at lib/helpers/formDataToJSON.js:60 inside buildPath. After two continue calls to reach the third entry ('303') inside [worker 1] WorkerThread, the agent stepped twice with Debug next (to line 61, target[name] = [target[name], value];, then line 66) and evaluated JSON.stringify(target):
JSON.stringify(target) = '{"select3":[["301","302"],"303"]}' (string)
Maintainers' diff vs Mercury's diff
Maintainers' fix (lib/helpers/formDataToJSON.js, Jay / @jasonsaayman):
if (utils.hasOwnProp(target, name)) {
- target[name] = [target[name], value];
+ target[name] = utils.isArray(target[name])
+ ? target[name].concat(value)
+ : [target[name], value];
} else {
Mercury's diff (Take 1, lib/helpers/formDataToJSON.js):
if (utils.hasOwnProp(target, name)) {
- target[name] = [target[name], value];
+ target[name] = utils.isArray(target[name])
+ ? target[name].concat(value)
+ : [target[name], value];
} else {
Mercury's diff is byte for byte identical to the maintainers' fix.
Verification and media
After the edit, npx vitest run --project unit tests/unit/helpers/formDataToJSON.test.js passed (Test Files 1 passed (1), Tests 7 passed (7)) and npx eslint lib/helpers/formDataToJSON.js exited clean.

Watch the axios #7365 replay clip (29 s, MP4)
What the clip leaves out
The run took 53.8 s; the clip is 29 s, opens as the prompt finishes typing, and has two cuts:
- Cut 1: inspecting
package.json; a first try (aDebug breakpointscall that failed because no debug session existed yet, a launch with no breakpoint, and aDebug outputread); the second launch, which stopped at:60, and bothcontinuecalls; and the first two of three multi-fieldDebug evaluatecalls that returnedunknown adapter errorinside the Vitest worker thread. The third, made at the'303'entry, is still on screen when the clip resumes at the firstDebug next. - Cut 2: pre-final repaint frames.
Between the cuts the footage is retimed as described in the rules above, and the last screen is held for 4.5 s.
Run it yourself
HUSKY=0 keeps husky out of the clone's git configuration.
mkdir -p axios-replay && cd axios-replay
git init -q && git remote add origin https://github.com/axios/axios.git
git fetch -q --depth 2 origin 0912bde937c9505ce5464d5b9c56b81d1edeab63
git checkout -q 8b68491d04838aaab5d1a4d30e23d1f534beceeb
HUSKY=0 npm ci --no-audit --no-fund
git checkout 0912bde937c9505ce5464d5b9c56b81d1edeab63 -- tests/unit/helpers/formDataToJSON.test.js
npx vitest run tests/unit/helpers/formDataToJSON.test.js
The recorded take ran in a copy of the tree prepared this way, made without .git and committed once into a new repository.
Then run mercury in axios-replay and enter:
The test "should keep repeatable values flat for 3+ entries" in tests/unit/helpers/formDataToJSON.test.js fails. Find out why with the debugger and fix the cause.
What this does not show
- Training exposure: all three fixes had been public for months before these runs (Flask PR #5797 merged on 18 August 2025, axios PR #10676 on 9 April 2026 and Fastify PR #6678 on 19 April 2026). A model can have met the issue or fix in training. On Fastify and axios the working copy held the fix's test but not the fix commit; even so, a diff matching the maintainers' proves less than the path to it: setting a breakpoint, reading a live value and making a fix that follows from that value.
- Not a benchmark: three bugs are three worked examples, not a score across a suite.
- Selection criteria: all three were picked because they fit five constraints: a closed issue with the maintainers' fix commit, a test from the project's own suite that fails at the parent and passes at the fix, a cause readable at one breakpoint, a fix of a few lines and a quick local install. Candidate bugs with larger fixes, tests running under Mocha (outside
vitest,jestandnode:test), or errors thrown intentionally with no wrong value to read were set aside.
Try it yourself
Install Mercury CLI:
curl -fsSL https://mercury-cli.ai/install | sh
See Debug a failing pytest test and Debug a failing Node test for step-by-step guides to the debugger tools used in these runs.