anomalyco / anomalyco/opencode

tui unit tests are not wired into CI

Open
#41,876 0 comments 0 reactions 1 assignee View on GitHub

@kommander is already working on this.

Since Aug 11, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

turbo.json defines test tasks per package and there's no entry for @opencode-ai/tui, so bun turbo test skips the 194 tests in packages/tui. bun turbo test --dry=json lists only five test tasks: opencode, core, app, ui, session-ui.

The v2 branch already has @opencode-ai/tui#test and runs these on both CI legs, so this looks like something that got missed rather than a deliberate exclusion.

Two things fail once you turn them on for Windows.

  1. abbreviateHome in packages/tui/src/runtime.tsx builds its result with path.sep, so it returns ~\project while runtime.test.tsx expects ~/project. Not just a test problem either: feature-plugins/sidebar/footer.tsx splits that value on / to build the breadcrumb, so on Windows the split never fires and the parent path gets dropped. v2 already fixed this: packages/tui/src/util/path-format.ts returns "~/" + relative.split(paths.sep).join("/") and picks win32 or posix based on the shape of the input path.

  2. captureSettledFrame in test/cli/tui/diff-viewer-file-tree.test.tsx polls five times at 25ms for a non-blank frame, then returns the blank frame anyway, so the test ends up asserting against ten lines of spaces. Fails about one run in three for me. Raising the budget and throwing on exhaustion clears it. waitForFrame from @opentui/core looks like the tidier answer but doesn't work here, since it bails as soon as the scheduler reports nothing scheduled and this test renderer only produces frames on an explicit renderOnce().

Happy to put together a PR for this if it lines up with what you'd want. It splits naturally into the runtime.tsx fix and the CI wiring, so let me know if you'd rather see those separately.

OpenCode version

1.18.16, dev at 3a90639

Steps to reproduce
  1. cd packages/tui && bun test on Windows
  2. runtime.test.tsx fails with Expected "~/project" / Received "~\project"
  3. The DiffViewerFileTree tests fail intermittently, asserting against a blank frame
  4. bun turbo test --dry=json from the repo root shows no @opencode-ai/tui#test task, so none of this runs in CI today
Operating System

Windows 11. Also checked on Ubuntu under WSL, where the suite passes.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.