Skip to content

test: fix the tests that fail on the sandbox branch itself - #69

Merged
t3-code-sandboxes[bot] merged 6 commits into
feat/sandbox-environmentsfrom
test/sandbox-flaky-fixtures
Nov 15, 2026
Merged

t3-code-sandboxes[bot] merged 6 commits into
feat/sandbox-environmentsfrom
test/sandbox-flaky-fixtures

Conversation

@t3-code-sandboxes

@t3-code-sandboxes t3-code-sandboxes Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Problem. Some tests fail on feat/sandbox-environments itself, independent of the sandbox PR stack (#60–#68). Some come from stale fixtures and mocks, two from upstream render regressions the fork still carries, one from a test race, and the rest from the machine running them.

Fix.

  • Tailscale script test (sandboxSetup.test.ts): the harness stubbed sudo, tailscale and tailscaled but not systemctl, so on a host running systemd the script restarted the real tailscaled. The TUN check also used a fixed /dev/net/tun. The test now stubs systemctl and provides its own TUN under the script's root, and tailscalePaths gains tun (/dev/net/tun with the default root, so production is unchanged).
  • remote-parent fixture (web): the child shell lacked the required modelSelection, hidden by a cast.
  • Mobile composer permissions (9 tests): the ./threads mock didn't export sandboxStartQueue, which the hook reads since the sandbox start-queue work.
  • Render scenarios (web): backports upstream dd50613 (perf(web): completed Markdown blocks no longer render twice pingdotgg/t3code#33794: finished Markdown blocks re-rendered while streaming, 59 vs 30) and f968db1 (perf(web): opening a thread from a draft only renders its sidebar row pingdotgg/t3code#33435: every sidebar row re-rendered on a thread switch, 4 vs 2). Both regressions predate the sandbox work and are fixed on upstream main.
  • ACP project picker test: backports upstream 294a841 (test(web): ACP project picker test waits for the popup to take focus pingdotgg/t3code#33061), which waits for the popup to take focus before pressing keys. Without it, keys pressed under load were lost.
  • Not changed:
    • ServerBrowser.test.ts (8) and ProjectionStore.test.ts (1) need Node 26 (Uint8Array.fromBase64, StatementSync.stat), as pinned in engines and used by CI. They pass under Node 26.12.1.
    • The other 12 render-scenario failures only appear when the scenarios run without scripts/render-metrics.ts.

Test plan

  • sandboxSetup.test.ts tailscale case and ThreadRelationshipsControl.remote-parent.browser.test.tsx pass (failed on the base)
  • thread-task-permissions.test.ts 11/11 (base: 2/11)
  • node scripts/render-metrics.ts run --runs 1 16/16 (base: 2 failed); ChatMarkdown and markdownRenderer tests 41/41
  • AcpSessionManagementSection.browser.test.tsx 14/14
  • ServerBrowser and ProjectionStore 151/151 under Node 26.12.1
  • vp run check:changed origin/feat/sandbox-environments

Claude Opus 5.5 via Claude Code.

🤖 Generated with Claude Code

OmarAlex24 and others added 5 commits November 14, 2026 00:56
…emd and TUN

On a host with systemd running and a tailscaled unit, the script took the
systemd branch and restarted the real unit instead of the stubbed daemon,
so it reported ERROR start. Stub systemctl in the harness and route the
TUN check through the root prefix so the test pins it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The panel now checks whether the current thread is a sandbox mirror, which
reads modelSelection.instanceId. The contracts require modelSelection on
every thread shell, so the fixture, not the code, was incomplete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b703713 made useThreadComposerState read sandboxStartQueue from ./threads,
but the test's ./threads mock never exported it, so 9 of 11 cases threw on render.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The renders project (only run through scripts/render-metrics.ts, not CI) failed
app-stream-assistant-turn (MarkdownParagraph 59, expected 30) and app-switch-thread
(SidebarThreadRow 4, expected 2). Both fail identically on the upstream base the
fork sits on (065aca4) and pass on upstream main; the sandbox work did not cause them.

- Streaming re-rendered each finished Markdown block once more when the next block
  arrived, because its `cache` prop flipped. Upstream dd50613 (pingdotgg#33794, Lakshmi
  Tanmay) renders once and remembers the element in an effect.
- Every sidebar row re-rendered on thread navigation through the
  `openPullRequestsInRightPanel` prop and an unstable `startThreadRename`. Upstream
  f968db1 (pingdotgg#33435, Dominik Zabcik) reads the flag at click time and stabilises the
  callback; bisected as the first upstream commit that passes app-switch-thread.

(cherry picked from commit dd50613)
(cherry picked from commit f968db1)

Co-Authored-By: Lakshmi Tanmay <lakshmi@voltcrash.com>
Co-Authored-By: Dominik Žabčík <35886301+dominikzabcik@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ingdotgg#33061)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit 294a841)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@t3-code-sandboxes t3-code-sandboxes Bot changed the title test: sandbox tailscale and remote-parent tests pass on any host test: fix the tests that fail on the sandbox branch itself Nov 15, 2026
…test/sandbox-flaky-fixtures

# Conflicts:
#	apps/web/test/appScenarios.renders.tsx
@t3-code-sandboxes
t3-code-sandboxes Bot merged commit 3b746e2 into feat/sandbox-environments Nov 15, 2026
@t3-code-sandboxes
t3-code-sandboxes Bot deleted the test/sandbox-flaky-fixtures branch November 15, 2026 21:19
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.

2 participants