Skip to content

test(ui-backend-claude): count relay directories in a private temp directory (#4250) - #4253

Merged
schlessera merged 1 commit into
mainfrom
fix/4250-autonomous-envelope-private-tmpdir
Nov 18, 2026
Merged

schlessera merged 1 commit into
mainfrom
fix/4250-autonomous-envelope-private-tmpdir

Conversation

@schlessera

@schlessera schlessera commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Refs #4250 (red-main incident; this is its second declared fix). Follows #4251.

What this does

#4251 fixed the browser failure; main run 44219495479 at 7a15151 passed all three browser shards. The same run failed unit (3) on packages/ui-backend-claude/tests/autonomous-envelope.test.ts "finishing the turn stops its relay": expected length 1, received length 2. The incident record added that failure to #4250, so main stays red until it passes.

Cause:

Fix:

  • The file runs with a TMPDIR of its own, created in beforeAll and restored in afterAll. Bun's tmpdir() reads TMPDIR on each call.
  • relayDirs asserts it is reading that private directory, so the redirect cannot silently stop working.

Proof

  • Failing first, under contention: a loop kept creating brain-inference-noise-* directories in /tmp. The unfixed test then fails with "Received length: 8", the main run's assertion. Fixed, the file passes 15/15, three times, under the same loop.
  • Mutation: with the TMPDIR redirect removed, every relay assertion fails on "relays are counted in this file's own temp directory". Restored.
  • Same bug class elsewhere: turn-data-tree-placement, turn-data-tree (two places) and the server-host-relay-probe fixture diff or count shared temp-directory prefixes the same way. They are filed as test: temp-directory diffs count other processes' directories (turn-data-tree, relay probe) #4252, with no milestone, to keep this declared fix minimal.
  • check:pr passes.

Collisions

bun scripts/collisions.ts --json --pr 4253 at head 396a0b5: closure reports with #3059, #3069, #3581, #3622, #4151, #4234, #4238, #4248.

{"version":1,"kind":"brain-check-pr-receipt","head":"396a0b5e30381528a696af91906966ffe17254cf","base":"origin/main","mode":"focused","startedAt":"2026-11-18T02:25:17.566Z","finishedAt":"2026-11-18T02:25:43.521Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":12821.64194},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":105.3018140000022},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":68.17350599999918},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":17.594939999999042},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":12926.617085000002}]}

🤖 Generated with Claude Code

…rectory (#4250)

The relay-directory assertions diffed the shared temp directory before
and after a turn, so a relay another test process created at the same
time counted as this turn's: main run 44219495479 saw 2 where 1 was
expected. The file now runs with a TMPDIR of its own, and relayDirs
asserts it is reading that directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@schlessera schlessera added this to the 0.45.0 milestone Nov 18, 2026
@schlessera

Copy link
Copy Markdown
Owner Author

Independent review

Reviewed head 396a0b5 against base 7a15151. Reviewer: agent. No findings.

{
  "version": 1,
  "kind": "brain-review-receipt",
  "pr": 4253,
  "head": "396a0b5e30381528a696af91906966ffe17254cf",
  "base": "7a151513fc814cccb67b354d4403d41dfb7b0487",
  "reviewer": "agent",
  "outcome": "no-findings",
  "findings": []
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant