Cause: "a stream that breaks off" errored the fake's response body with
ctl.error(new Error("connection reset")). Bun prints a response body's
error on every run, even with an error handler on the server, so every
run of the file printed "error: connection reset" at that line while the
test passed. #268 read that print as a red. It was never a failure: 40
of 40 printed it and passed under load on origin/main.
The fake now stops its server mid-body, a real broken connection: the
plugin still ends with Trae CN's error and [DONE], and nothing is printed.
Run on macOS arm64, bun 1.4.2:
- origin/main: 8 parallel `bun test --rerun-each 40 -t "breaks off"`:
every run printed the error, 0 fail.
- This change: 6 parallel `bun test --rerun-each 30
packages/trae/stream.test.mjs` at load average ~55: 6 x 420 pass,
0 fail, 0 printed.
- `HOME=$(mktemp -d) bun test` from the root: 1920 pass, 0 fail.
`bun scripts/check.mjs`: ok.
Test-only, no version bump.
A check-in claim answering extra_credits alone is credited (NaN before); an
empty reasoning_content no longer hides the event's reasoning; a native call's
name snapshot that grows takes the place of its first piece; a Global reply's
error names Trae Global.
Run at the reviewed head 2a0a835, merged with #257 and #273 on main 68170b3:
bun test in packages/trae 173 pass 0 fail; check.mjs trae ok. The new tests
fail on main's index.mjs. Not tried against a live Trae account.
The test's fake server sent one event, waited 30 ms and errored the body.
The plugin reads its first part before it answers. Under the whole repo's
`bun test` that read sometimes started after the reset, and Bun then drops
the event it had already received. The read threw ECONNRESET out of the
plugin's fetch instead of reaching the mid-stream path the test covers
(1259 pass, 1 fail at a6bed5e). The reset now waits until the caller has
read "half", so the plugin has always read it first. Only the test
changed. index.mjs is untouched, so there's no version bump.
Run at a6bed5e + this change, TMPDIR and HOME set to a scratch dir:
- before the change, repo-root `bun test`: 1259 pass, 1 fail (this test).
A 200 ms pause put by hand before the plugin's first read failed it
every time when run alone.
- after: repo-root `bun test` 1259 pass, 0 fail, 1 skip (exit 0);
packages/trae `bun test` 129 pass; stream.test.mjs alone 3/3;
`bun scripts/check.mjs` exit 0.
- with the same 200 ms pause in place: passes.
- broke it by hand: index.mjs ending a broken stream with finish "stop"
and no error turns this test red.
- grep found no other test that resets a body on a timer.
Not tried: CI's Linux runner. CI's publish runs had passed this test so
far (e.g. 38572309548). Their red was the zed and zen-free Trusted
Publisher 404s.