Skip to content

packages/console/app has no test script, so CI never runs its tests — 3 of 8 are broken on dev #44614

Description

@xyzs996

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions