anomalyco / anomalyco/opencode
packages/console/app has no test script, so CI never runs its tests — 3 of 8 are broken on dev
@Hona is already working on this.
Since Aug 24, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
packages/console/app declares no test script, so bun turbo test never touches packages/console/app/test/. Three of the eight tests in that directory are broken on dev today, and nothing reports it.
Reproduce
bun install
cd packages/console/app
bun test test/
On a clean dev checkout:
# Unhandled error between tests
error: Cannot find module '../src/routes/zen/util/requestBody'
from '/…/packages/console/app/test/requestBody.test.ts'
(fail) provider usage extraction > extracts Google non-stream usage metadata
(fail) provider usage extraction > parses Google stream usage metadata
5 pass
3 fail
1 error
Ran 8 tests across 3 files.
The three failures
1. requestBody.test.ts imports a module that no longer exists. It imports prepareRequestBody from ../src/routes/zen/util/requestBody; that file is not in the tree, and grep -rn prepareRequestBody --include=*.ts packages matches only the test file itself. All four of its cases are dead — the function they cover was removed and the test was left behind.
2 & 3. Two Google cases assert a stale outputTokens. Both extracts Google non-stream usage metadata and parses Google stream usage metadata feed candidatesTokenCount: 3, thoughtsTokenCount: 2 and expect outputTokens: 3, while google.ts:68 returns outputTokens + reasoningTokens = 5:
const outputTokens = usage.candidatesTokenCount ?? 0
const reasoningTokens = usage.thoughtsTokenCount ?? 0
…
outputTokens: outputTokens + reasoningTokens,
The helper looks right — Gemini's candidatesTokenCount excludes thinking tokens, so total output really is the sum — which makes the expectations the stale side. But that is a billing-adjacent call, so I would rather have a maintainer confirm the direction than guess: is outputTokens meant to be the billable output total (helper correct, fix the expectations to 5), or the visible-completion count with thinking tracked only in reasoningTokens (expectations correct, fix the helper)?
Why it went unnoticed
Root package.json lists packages/console/* as a workspace, so packages/console/app is a turbo target — but its scripts block has typecheck, dev, dev:remote, build, start and no test. .github/workflows/test.yml runs bun turbo test, which skips any package without the task. Sibling packages (core, llm, opencode, tui, ui, …) all declare one, so this reads as an omission rather than a decision.
Practical consequence beyond the three failures: regression guards added under packages/console/app/test/ are never executed by CI. #44229 adds one there right now — an assertion that the four token buckets partition the prompt exactly — and as things stand it would pass on my machine and never run on yours.
Suggested fix
Add to packages/console/app/package.json:
"test": "bun test"
then resolve the three failures — delete requestBody.test.ts (or restore what it covers, if its removal was accidental), and correct whichever side of the Google outputTokens pair is wrong.
Happy to open the PR once you say which direction the Google expectation should move; I'd rather not pick that one for you.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.