Skip to content

Orphaned sidebar tests fail on main since the v1.14.0.0 sidebar rip (87 failures across 4 files) #2420

Description

@meshailabs

Summary

Four browse/test/sidebar-*.test.ts files fail on a pristine checkout of main (a325940). They test HTTP endpoints and a source file that were deliberately removed in v1.14.0.0 (ed1e4be, #1216, 2026-04-25) when the sidebar chat queue was replaced by the interactive PTY. The endpoints went away; the tests did not.

Reproduce

git clone https://github.com/garrytan/gstack.git && cd gstack
bun install
bun test ./browse/test/sidebar-integration.test.ts

Environment: bun 1.3.14, Linux 6.6.114.1 (WSL2) x86_64, commit a325940, clean tree (git status empty).

Per-file results

File Result Cause
sidebar-ux.test.ts 103 pass, 73 fail ENOENT: no such file or directory, open 'browse/src/sidebar-agent.ts'
sidebar-integration.test.ts 2 pass, 11 fail /sidebar-* endpoints 404
sidebar-tabs.test.ts 26 pass, 2 fail assertions against changed file content
sidebar-security.test.ts 0 pass, 1 fail
sidebar-unit.test.ts 18 pass, 0 fail unaffected

Root cause

browse/src/server.ts:2508 documents the removal:

// ─── Sidebar chat endpoints ripped ──────────────────────────────
// /sidebar-tabs, /sidebar-tabs/switch, /sidebar-chat[/clear],
// /sidebar-command, /sidebar-agent/{event,kill,stop},
// /sidebar-queue/dismiss, /sidebar-session{,/new,/list} all lived
// here. They drove the one-shot claude -p chat queue. Replaced by
// the interactive PTY in terminal-agent.ts; the queue + browser-tab
// multiplexing are no longer needed.

sidebar-integration.test.ts still calls those routes. The server starts fine and writes its state file, so the harness gets a valid port and token, but the endpoints now return a plain-text 404:

$ curl -i -H "Authorization: Bearer $TOK" http://127.0.0.1:$PORT/sidebar-session
HTTP/1.1 404 Not Found
content-type: text/plain;charset=utf-8

Not found

The test does await (await api('/sidebar-session')).json(), which throws SyntaxError: Failed to parse JSON. That is the error all 11 failures surface as, and it disguises the real problem: the endpoint is gone, not malformed.

Separately, browse/src/sidebar-agent.ts was deleted in the same commit (terminal-agent.ts is its replacement), but sidebar-ux.test.ts still opens it by path, producing the 73 ENOENT failures.

Why this went unnoticed

No workflow runs the full bun test:

  • windows-free-tests.yml runs a hand-picked list (test/gstack-paths.test.ts, browse/test/claude-bin.test.ts, test/test-free-shards.test.ts, browse/test/file-permissions.test.ts)
  • evals.yml / evals-periodic.yml run specific matrix suite files under EVALS=1
  • skill-docs.yml, actionlint.yml, version-gate.yml, pr-title-sync.yml, make-pdf-gate.yml do not run tests

So these files have never executed in CI, and main has been red locally since 2026-04-25.

Why it matters

CONTRIBUTING.md presents bun test as the tier-1 gate:

| Tier | Command | Cost | What it tests |
| 1 — Static | bun test | Free | ... runs on every commit, <5s |

A new contributor's very first bun test is red with 87 failures and no way to tell whether they caused any of it. I hit this while preparing #2419 and had to stash my change and diff test runs to prove my one-line addition was not responsible.

Suggested fix

Delete the orphaned files, or rewrite them against terminal-agent.ts. sidebar-unit.test.ts passes and presumably still covers live code, so this is not a blanket removal of sidebar-*.

Worth considering alongside: a workflow that actually runs bun test, otherwise the next orphaned suite goes unnoticed the same way.

Related: the suite cannot report failure at all

The observation I originally left here as low-confidence is confirmed and filed separately as #2421: bun test exits 0 after running about 23 of 409 files, killed by stray process.exit(0) timers in seven test files and in design/src/daemon.ts.

That is why the 87 failures above have gone unnoticed even by anyone running the suite locally. The run dies before most of them are reached, and the exit code says success. #2421 should land before full bun test is wired into CI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions