Report a Stop that lands mid-action as a stop - #403
Merged
Conversation
kevin9327
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso and
tylerslaton
as code owners
September 6, 2026 13:31
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
# Conflicts: # CHANGELOG.md
davidmckayv
approved these changes
Sep 6, 2026
davidmckayv
left a comment
Contributor
There was a problem hiding this comment.
Deep-reviewed against live code (correctness, governance, no vendor/secret/scale issues). Composed build+tests green. CHANGELOG/format rebase on CI-validated substance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
A person presses Stop on a click, a keystroke or a long shell command, and is told:
It is running. They stopped it.
The transport already knows how to say that, and says it only for a Stop that arrives before the
request leaves:
The caller's signal is then handed to
fetchprecisely so a Stop can land mid-flight:and a fetch aborted that way rejects with an
AbortError. The catch sorts errors into exactly twokinds, and
AbortErroris neither:Both of those are statements about the infrastructure, and the mid-flight window is the whole point
of passing the signal at all — a Stop pressed while a 600-second shell command runs is exactly the
case the abort plumbing exists for.
Why the message matters beyond the model
It is not only what the Bot reads. The gateway writes it into the action's audit row:
So a person deliberately stopping an action is recorded on the audit page as the computer being
down. That is the same class of thing as #302 and #351: a row that names something other than what
happened. It also fires whenever the browser tab closes mid-request, since Bun aborts
context.req.raw.signalthen, so a closed tab is filed as an outage too.Fix
The caller's own abort is answered first, with the sentence the pre-flight check already uses.
Anything else reaches the existing two branches untouched.
Reading
caller.abortedrather than the thrown error's name is deliberate: it asks the questionthat actually matters — did the person stop this — instead of inferring it from a DOMException name
that varies between runtimes.
Where it runs
the action it stops, so the process that is serving it is the one that sees the abort; nothing
here is shared between processes.
the same response and into the same audit row as before.
Boundary and audit
it, and only the wording of one failure changes.
action was stopped instead of naming an outage that did not happen.
it is serving, not a claim in a body.
Changelog
CHANGELOG.mdunderUnreleased.Tests
Three in
server/tests/computer-client.test.ts, under a newa person's Stopgroup:rejects with the
AbortErrora real fetch rejects with.other branch did not move.
Against
mainthe first fails:How I tested
Windows 11, Bun 1.3.14.
bun test server/tests/computer-client.test.tsis 21 passed, 0 failed, upfrom 18 by the three new tests. The neighbouring suites are unchanged:
computer-gateway57 passed,computer-sandbox8,computer-provider12,computer-session-guard5, all with no failures.bun run --filter server typecheckandbunx biome checkare clean.