Skip to content

CodeRabbit Generated Unit Tests: Add unit tests#537

Closed
coderabbitai[bot] wants to merge 75 commits intofix/guild-selector-categoriesfrom
coderabbitai/utg/2913a4d
Closed

CodeRabbit Generated Unit Tests: Add unit tests#537
coderabbitai[bot] wants to merge 75 commits intofix/guild-selector-categoriesfrom
coderabbitai/utg/2913a4d

Conversation

@coderabbitai
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot commented Apr 18, 2026

Unit test generation was requested by @BillChirico.

The following files were modified:

  • tests/api/utils/configValidation.test.js
  • tests/modules/cli-process.test.js
  • tests/modules/triage-config.test.js
  • tests/utils/anthropicClient.test.js

AnExiledDev and others added 30 commits April 10, 2026 03:24
Replace the CLI subprocess model (cli-process.js + anthropicClient.js) with
direct Vercel AI SDK calls via a new aiClient.js wrapper and aiCost.js for
automatic token cost tracking.

Key changes:
- Add generate() and stream() wrappers with retry logic (3-attempt exponential
  backoff), timeout/abort handling, and provider caching
- Automatic cost calculation via token-costs library with model ID normalization
- Split triage config: separate classifier (Haiku) and responder (Sonnet) models
  with per-role budgets, API keys, and base URLs
- Fix 19 issues found in migration review: CostClient race condition, cached
  token extraction, truncated classification confidence, thinkingTokens default,
  async onChunk safety, double-delete in automod, budget enforcement logging,
  timer cleanup, config validation gaps, and TypeScript type corrections
- Add 17 new tests covering retry logic, error classification, abort handling,
  race conditions, and all fixed edge cases
- Remove cli-process.js (22KB subprocess state machine) and anthropicClient.js
Any provider:model string now resolves automatically using
<PROVIDER>_API_KEY and <PROVIDER>_BASE_URL env vars, with
ANTHROPIC_API_KEY as fallback. Minimax and Codex work out of
the box — no provider-specific code needed.
- Add MiniMax local pricing table (token-costs doesn't cover it yet)
- Track cacheCreationInputTokens alongside cacheReadInputTokens
- Use authToken instead of apiKey for non-Anthropic providers
- Fix provider metadata extraction to check provider-specific key
  before falling back to anthropic
- Fix MiniMax base URL to include /v1 suffix
- Harden JSON fence stripping for providers that prepend whitespace
- Genericize error messages from "Anthropic" to "AI provider"
- Remove stale DISABLE_PROMPT_CACHING references
- Update tests for all of the above
- Convert aiClient.js to lazy-load @ai-sdk/anthropic and ai modules
- Add preloadSDK() for background pre-warming at startup
- Add detailed timing breakdowns to generate() and stream()
- Add timing instrumentation to triage classification and response
- Simplify aiCost.js to use local model-pricing.json lookup
- Update config to use MiniMax models and reduce contextMessages to 5
- Fix various test mocks for new SDK patterns

Performance improvements:
- Bot startup no longer blocked by ~6s SDK import
- SDK preloads in background while Discord connects
- Timing logs identify latency sources (API vs SDK vs Discord)

Known issue: Response latency of 8-16s with MiniMax provider
needs further optimization (API-side, not SDK).
Bumps [simple-icons](https://github.com/simple-icons/simple-icons) from 16.15.0 to 16.16.0.
- [Release notes](https://github.com/simple-icons/simple-icons/releases)
- [Commits](simple-icons/simple-icons@16.15.0...16.16.0)

---
updated-dependencies:
- dependency-name: simple-icons
  dependency-version: 16.16.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [turbo](https://github.com/vercel/turborepo) from 2.9.3 to 2.9.6.
- [Release notes](https://github.com/vercel/turborepo/releases)
- [Changelog](https://github.com/vercel/turborepo/blob/main/RELEASE.md)
- [Commits](vercel/turborepo@v2.9.3...v2.9.6)

---
updated-dependencies:
- dependency-name: turbo
  dependency-version: 2.9.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 10.47.0 to 10.48.0.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md)
- [Commits](getsentry/sentry-javascript@10.47.0...10.48.0)

---
updated-dependencies:
- dependency-name: "@sentry/node"
  dependency-version: 10.48.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [@biomejs/biome](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome) from 2.4.10 to 2.4.11.
- [Release notes](https://github.com/biomejs/biome/releases)
- [Changelog](https://github.com/biomejs/biome/blob/main/packages/@biomejs/biome/CHANGELOG.md)
- [Commits](https://github.com/biomejs/biome/commits/@biomejs/biome@2.4.11/packages/@biomejs/biome)

---
updated-dependencies:
- dependency-name: "@biomejs/biome"
  dependency-version: 2.4.11
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps @paper-design/shaders-react from 0.0.72 to 0.0.74.

---
updated-dependencies:
- dependency-name: "@paper-design/shaders-react"
  dependency-version: 0.0.74
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [pnpm/action-setup](https://github.com/pnpm/action-setup) from 5.0.0 to 6.0.0.
- [Release notes](https://github.com/pnpm/action-setup/releases)
- [Commits](pnpm/action-setup@v5.0.0...v6.0.0)

---
updated-dependencies:
- dependency-name: pnpm/action-setup
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [anthropics/claude-code-action](https://github.com/anthropics/claude-code-action) from 1.0.92 to 1.0.93.
- [Release notes](https://github.com/anthropics/claude-code-action/releases)
- [Commits](anthropics/claude-code-action@657fb7c...b47fd72)

---
updated-dependencies:
- dependency-name: anthropics/claude-code-action
  dependency-version: 1.0.93
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 7.0.0 to 7.0.1.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v7.0.0...v7.0.1)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 7.0.0 to 7.1.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](docker/build-push-action@v7.0.0...v7.1.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [mem0ai](https://github.com/mem0ai/mem0/tree/HEAD/mem0-ts) from 2.4.2 to 2.4.6.
- [Release notes](https://github.com/mem0ai/mem0/releases)
- [Changelog](https://github.com/mem0ai/mem0/blob/ts-v2.4.6/docs/changelog.mdx)
- [Commits](https://github.com/mem0ai/mem0/commits/ts-v2.4.6/mem0-ts)

---
updated-dependencies:
- dependency-name: mem0ai
  dependency-version: 2.4.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [diff](https://github.com/kpdecker/jsdiff) from 8.0.4 to 9.0.0.
- [Changelog](https://github.com/kpdecker/jsdiff/blob/master/release-notes.md)
- [Commits](kpdecker/jsdiff@8.0.4...v9.0.0)

---
updated-dependencies:
- dependency-name: diff
  dependency-version: 9.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [dotenv](https://github.com/motdotla/dotenv) from 17.4.0 to 17.4.2.
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](motdotla/dotenv@v17.4.0...v17.4.2)

---
updated-dependencies:
- dependency-name: dotenv
  dependency-version: 17.4.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [@anthropic-ai/claude-code](https://github.com/anthropics/claude-code) from 2.1.101 to 2.1.105.
- [Release notes](https://github.com/anthropics/claude-code/releases)
- [Changelog](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md)
- [Commits](anthropics/claude-code@v2.1.101...v2.1.105)

---
updated-dependencies:
- dependency-name: "@anthropic-ai/claude-code"
  dependency-version: 2.1.105
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps @paper-design/shaders-react from 0.0.74 to 0.0.75.

---
updated-dependencies:
- dependency-name: "@paper-design/shaders-react"
  dependency-version: 0.0.75
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [gsap](https://github.com/greensock/GSAP) from 3.14.2 to 3.15.0.
- [Commits](greensock/GSAP@3.14.2...3.15.0)

---
updated-dependencies:
- dependency-name: gsap
  dependency-version: 3.15.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [anthropics/claude-code-action](https://github.com/anthropics/claude-code-action) from 1.0.93 to 1.0.94.
- [Release notes](https://github.com/anthropics/claude-code-action/releases)
- [Commits](anthropics/claude-code-action@b47fd72...1c8b699)

---
updated-dependencies:
- dependency-name: anthropics/claude-code-action
  dependency-version: 1.0.94
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [next-auth](https://github.com/nextauthjs/next-auth) from 4.24.13 to 4.24.14.
- [Release notes](https://github.com/nextauthjs/next-auth/releases)
- [Commits](https://github.com/nextauthjs/next-auth/compare/next-auth@4.24.13...next-auth@4.24.14)

---
updated-dependencies:
- dependency-name: next-auth
  dependency-version: 4.24.14
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [@anthropic-ai/claude-code](https://github.com/anthropics/claude-code) from 2.1.105 to 2.1.109.
- [Release notes](https://github.com/anthropics/claude-code/releases)
- [Changelog](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md)
- [Commits](anthropics/claude-code@v2.1.105...v2.1.109)

---
updated-dependencies:
- dependency-name: "@anthropic-ai/claude-code"
  dependency-version: 2.1.109
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Volvox Bot and others added 14 commits April 17, 2026 05:40
…on override

- biome.json: bump $schema to 2.4.12 to match @biomejs/biome ^2.4.12 devDep
- package.json: drop brace-expansion override; it forced ^2.0.2 which lacks the
  named `expand` export that minimatch@10.2.5 imports, breaking 32+ test files
  via node-pg-migrate -> glob -> minimatch. Natural pnpm resolution already
  picks post-CVE-2025-5889 versions across the dep tree (1.1.12, 2.1.0, 5.0.5).
- pnpm-lock.yaml: regenerated
- src/modules/triage-respond.js: biome auto-format (single-line ternary)
- tests/utils/aiCost.test.js: drop unused `key` destructuring in for-of
Bumps [typescript](https://github.com/microsoft/TypeScript) from 6.0.2 to 6.0.3.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Commits](microsoft/TypeScript@v6.0.2...v6.0.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-version: 6.0.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [@sentry/node](https://github.com/getsentry/sentry-javascript) from 10.48.0 to 10.49.0.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md)
- [Commits](getsentry/sentry-javascript@10.48.0...10.49.0)

---
updated-dependencies:
- dependency-name: "@sentry/node"
  dependency-version: 10.49.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [anthropics/claude-code-action](https://github.com/anthropics/claude-code-action) from 1.0.97 to 1.0.99.
- [Release notes](https://github.com/anthropics/claude-code-action/releases)
- [Commits](anthropics/claude-code-action@905d4eb...c3d45e8)

---
updated-dependencies:
- dependency-name: anthropics/claude-code-action
  dependency-version: 1.0.99
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [@anthropic-ai/claude-code](https://github.com/anthropics/claude-code) from 2.1.110 to 2.1.112.
- [Release notes](https://github.com/anthropics/claude-code/releases)
- [Changelog](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md)
- [Commits](anthropics/claude-code@v2.1.110...v2.1.112)

---
updated-dependencies:
- dependency-name: "@anthropic-ai/claude-code"
  dependency-version: 2.1.112
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
minimatch@10.x does ESM named import from brace-expansion, but
brace-expansion@1.1.13 is CJS. The override forced 1.1.13 everywhere
including for minimatch 10.x which expects the ESM-native v5.x.

The brace-expansion ReDoS vuln only affects the old minimatch@3.1.5
path (swagger-jsdoc) which naturally resolves 1.1.12 — acceptable
risk for a dev-only dependency.
004_performance_indexes is a no-op placeholder that was added to fill
the gap after its indexes were merged into 001_initial-schema.
However, 004_voice_sessions was also created, creating two files
with the same prefix. node-pg-migrate sorts alphabetically and
expects 004_performance_indexes before 004_voice_sessions, but
production already ran 004_voice_sessions — causing a startup
crash on every deploy.

Removing the no-op placeholder fixes the ordering conflict.
Real performance indexes exist in 001_initial-schema and
017_performance_indexes.
Resolved conflicts:
- package.json: keep SDK deps (@ai-sdk/anthropic, ai), drop claude-code CLI, bump sentry to 10.49.0
- pnpm-lock.yaml: regenerated
- aiClient: use Number.parseFloat (lint compliance)
- aiClient: fix withRetry abort listener leak (remove on timer resolve)
- aiClient: fail hard when non-Anthropic provider has no baseUrl
- aiClient: record streamStarted inside withRetry callback for accurate timing
- triage-respond: guard redundant RECENT_LIMIT fetch when buffer empty
- triage-respond: use shared parseProviderModel helper (no duplication)
- modelString: extract pure provider:model parser to avoid test mock churn
- .env.example: clarify that missing provider key fails at invocation, not startup
- tests: update aiClient test to expect new baseUrl-required contract
- footer.test: expect [Locked] instead of OVERSIGHT_LOCKED
- home.spec E2E: use 'Network Status' instead of 'Trusted by'
- home.spec E2E: use 'Active Users'/'Uptime' instead of
  'Commands Processed'/'Current Uptime'
The test's requestAnimationFrame mock fired callbacks synchronously via
queueMicrotask, creating an infinite RAF→setState→re-render→RAF spiral
that caused JavaScript heap out of memory on CI.

Fix: mock useInView to return false (animation never starts) and remove
the RAF mock entirely since it's no longer needed.
Copilot AI review requested due to automatic review settings April 18, 2026 21:33
@coderabbitai coderabbitai Bot review requested due to automatic review settings April 18, 2026 21:33
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 18, 2026

⚠️ No Changeset found

Latest commit: 3570667

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor Author

coderabbitai Bot commented Apr 18, 2026

Important

Review skipped

This PR was authored by the user configured for CodeRabbit reviews. CodeRabbit does not review PRs authored by this user. It's recommended to use a dedicated user account to post CodeRabbit review feedback.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 98bf2062-c647-4978-a72b-ad5a99185e88

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands and usage tips.

@railway-app
Copy link
Copy Markdown

railway-app Bot commented Apr 18, 2026

🚅 Deployed to the volvox-bot-pr-537 environment in volvox-bot

Service Status Web Updated (UTC)
web ✅ Success (View Logs) Apr 18, 2026 at 9:35 pm
bot ❌ Build Failed (View Logs) Web Apr 18, 2026 at 9:35 pm

@railway-app railway-app Bot temporarily deployed to volvox-bot / volvox-bot-pr-537 April 18, 2026 21:34 Destroyed
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots
17.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 18, 2026

Greptile Summary

This PR adds four Vitest test files covering configValidation, triage-config, cli-process, and anthropicClient. The tests are well-structured with good happy-path and error-case coverage, but several files test against source modules that either do not exist or have diverged from the tests.

  • src/utils/anthropicClient.js and src/modules/cli-process.js are missing — both test files will error out entirely at the dynamic import, meaning 0 of their ~60 combined tests run.
  • triage-config.test.js asserts streaming, tokenRecycleLimit, and a thinkingTokens default of 4096 — none of which match the current resolveTriageConfig source.
  • configValidation.test.js (the new triage describe block) tests triage.streaming and triage.tokenRecycleLimit which are absent from CONFIG_SCHEMA.triage.properties.

Confidence Score: 2/5

Not safe to merge — two test files import non-existent source modules and two others have assertions that contradict the live implementation, meaning the test suite will fail on CI.

Four distinct P1 failures span all four changed files. Two source files are completely absent (anthropicClient.js, cli-process.js), and the triage tests have wrong default values and missing schema fields.

All four test files need attention: tests/utils/anthropicClient.test.js and tests/modules/cli-process.test.js require their source modules to be created; tests/modules/triage-config.test.js requires resolveTriageConfig to be updated; tests/api/utils/configValidation.test.js requires streaming and tokenRecycleLimit added to CONFIG_SCHEMA.triage.

Important Files Changed

Filename Overview
tests/utils/anthropicClient.test.js Tests for Anthropic SDK singleton client — entire file will fail at import because src/utils/anthropicClient.js does not exist in the repository.
tests/modules/cli-process.test.js Comprehensive 1,300-line test suite for CLIProcess/AsyncQueue — all tests will fail at the dynamic import because src/modules/cli-process.js is absent from the repository.
tests/modules/triage-config.test.js Tests for resolveTriageConfig, isChannelEligible, getDynamicInterval — source file exists but tests assert streaming, tokenRecycleLimit, and thinkingTokens defaults that don't match the current implementation.
tests/api/utils/configValidation.test.js Extensive schema validation tests — the majority are correct against the live source, but the new triage describe block tests two properties (streaming, tokenRecycleLimit) missing from CONFIG_SCHEMA.triage.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[tests/api/utils/configValidation.test.js] -->|imports| B[src/api/utils/configValidation.js ✅ exists]
    C[tests/modules/triage-config.test.js] -->|imports| D[src/modules/triage-config.js ✅ exists]
    E[tests/modules/cli-process.test.js] -->|imports| F[src/modules/cli-process.js ❌ missing]
    G[tests/utils/anthropicClient.test.js] -->|imports| H[src/utils/anthropicClient.js ❌ missing]
    B --> B1{triage.streaming in schema?}
    B1 -->|No ❌| B2[triage-new-fields block FAILS]
    B1 -->|Yes ✅| B3[All other configValidation tests PASS]
    D --> D1{streaming / tokenRecycleLimit / thinkingTokens default correct?}
    D1 -->|No ❌| D2[triage-config default tests FAIL]
    D1 -->|Yes ✅| D3[channel eligibility + interval tests PASS]
    F --> F1[Dynamic import throws MODULE_NOT_FOUND]
    F1 --> F2[All 40+ cli-process tests FAIL]
    H --> H1[Dynamic import throws MODULE_NOT_FOUND]
    H1 --> H2[All 9 anthropicClient tests FAIL]
Loading

Comments Outside Diff (1)

  1. tests/modules/triage-config.test.js, line 13-18 (link)

    P1 Three assertions mismatch the current source implementation

    The current resolveTriageConfig in src/modules/triage-config.js:

    1. Does not return a tokenRecycleLimit field at all — so result.tokenRecycleLimit is undefined, not 20000 (line 18).
    2. Does not return a streaming field — so result.streaming is undefined, not false (line 22-24).
    3. Defaults thinkingTokens to 0 (triageConfig.thinkingTokens ?? 0), not 4096 (line 27-29).

    All three assertions will fail against the live source unless the source is updated to match.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: tests/modules/triage-config.test.js
    Line: 13-18
    
    Comment:
    **Three assertions mismatch the current source implementation**
    
    The current `resolveTriageConfig` in `src/modules/triage-config.js`:
    
    1. Does **not** return a `tokenRecycleLimit` field at all — so `result.tokenRecycleLimit` is `undefined`, not `20000` (line 18).
    2. Does **not** return a `streaming` field — so `result.streaming` is `undefined`, not `false` (line 22-24).
    3. Defaults `thinkingTokens` to `0` (`triageConfig.thinkingTokens ?? 0`), not `4096` (line 27-29).
    
    All three assertions will fail against the live source unless the source is updated to match.
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: tests/utils/anthropicClient.test.js
Line: 16-18

Comment:
**Source module does not exist — all tests will fail**

`src/utils/anthropicClient.js` does not exist in the repository. The dynamic import on line 16 will throw a module-not-found error at runtime, causing every test in this file to fail before any assertion runs. The file needs to be created (or the correct path resolved) before these tests can pass.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: tests/modules/cli-process.test.js
Line: 68-70

Comment:
**Source module does not exist — all tests will fail**

`src/modules/cli-process.js` does not exist in the repository. The dynamic import on line 68 will throw a module-not-found error, making the entire 1,300-line test file dead on arrival. All 40+ test cases will error out before any assertion is reached.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: tests/modules/triage-config.test.js
Line: 13-18

Comment:
**Three assertions mismatch the current source implementation**

The current `resolveTriageConfig` in `src/modules/triage-config.js`:

1. Does **not** return a `tokenRecycleLimit` field at all — so `result.tokenRecycleLimit` is `undefined`, not `20000` (line 18).
2. Does **not** return a `streaming` field — so `result.streaming` is `undefined`, not `false` (line 22-24).
3. Defaults `thinkingTokens` to `0` (`triageConfig.thinkingTokens ?? 0`), not `4096` (line 27-29).

All three assertions will fail against the live source unless the source is updated to match.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: tests/api/utils/configValidation.test.js
Line: 486-538

Comment:
**`triage.streaming` and `triage.tokenRecycleLimit` are absent from `CONFIG_SCHEMA`**

The entire `describe('triage schema — new fields (streaming, tokenRecycleLimit)', ...)` block will fail. In the current `src/api/utils/configValidation.js`, the `triage` object's `properties` map has no `streaming` or `tokenRecycleLimit` entries. As a result:

- `validateSingleValue('triage.streaming', true)` returns `['Unknown config path: triage.streaming']`, not `[]`.
- Every `validateSingleValue('triage.tokenRecycleLimit', ...)` call also returns the unknown-path error.
- `CONFIG_SCHEMA.triage.properties.streaming` is `undefined`, so the `toHaveProperty` / `toEqual` assertions on lines 530-537 fail.

The schema needs `streaming: { type: 'boolean' }` and `tokenRecycleLimit: { type: 'number', min: 0, max: 1000000 }` added to the `triage` properties before these tests can pass.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: tests/modules/cli-process.test.js
Line: 809-819

Comment:
**Test doesn't actually verify the retry-limit behavior**

The test body only asserts `typeof cli.restart === 'function'`, which will always be true regardless of whether the max-retry cap is wired up correctly. The comment explains the real behavior but the assertion doesn't exercise it — this test can never catch a regression in the cap logic.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "CodeRabbit Generated Unit Tests: Add uni..." | Re-trigger Greptile

Comment on lines +16 to +18
const { _setAnthropicClient, getAnthropicClient } = await import(
'../../src/utils/anthropicClient.js'
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Source module does not exist — all tests will fail

src/utils/anthropicClient.js does not exist in the repository. The dynamic import on line 16 will throw a module-not-found error at runtime, causing every test in this file to fail before any assertion runs. The file needs to be created (or the correct path resolved) before these tests can pass.

Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/utils/anthropicClient.test.js
Line: 16-18

Comment:
**Source module does not exist — all tests will fail**

`src/utils/anthropicClient.js` does not exist in the repository. The dynamic import on line 16 will throw a module-not-found error at runtime, causing every test in this file to fail before any assertion runs. The file needs to be created (or the correct path resolved) before these tests can pass.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +68 to +70
const { AsyncQueue, CLIProcess, CLIProcessError } = await import(
'../../src/modules/cli-process.js'
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Source module does not exist — all tests will fail

src/modules/cli-process.js does not exist in the repository. The dynamic import on line 68 will throw a module-not-found error, making the entire 1,300-line test file dead on arrival. All 40+ test cases will error out before any assertion is reached.

Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/modules/cli-process.test.js
Line: 68-70

Comment:
**Source module does not exist — all tests will fail**

`src/modules/cli-process.js` does not exist in the repository. The dynamic import on line 68 will throw a module-not-found error, making the entire 1,300-line test file dead on arrival. All 40+ test cases will error out before any assertion is reached.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +486 to +538
describe('triage schema — new fields (streaming, tokenRecycleLimit)', () => {
it('should accept valid triage.streaming boolean', () => {
expect(validateSingleValue('triage.streaming', true)).toEqual([]);
expect(validateSingleValue('triage.streaming', false)).toEqual([]);
});

it('should reject non-boolean triage.streaming', () => {
const errors = validateSingleValue('triage.streaming', 1);
expect(errors).toHaveLength(1);
expect(errors[0]).toContain('expected boolean');
});

it('should accept triage.tokenRecycleLimit within valid range', () => {
expect(validateSingleValue('triage.tokenRecycleLimit', 0)).toEqual([]);
expect(validateSingleValue('triage.tokenRecycleLimit', 20000)).toEqual([]);
expect(validateSingleValue('triage.tokenRecycleLimit', 1000000)).toEqual([]);
});

it('should reject triage.tokenRecycleLimit below minimum', () => {
const errors = validateSingleValue('triage.tokenRecycleLimit', -1);
expect(errors).toHaveLength(1);
expect(errors[0]).toContain('>= 0');
});

it('should reject triage.tokenRecycleLimit above maximum', () => {
const errors = validateSingleValue('triage.tokenRecycleLimit', 1000001);
expect(errors).toHaveLength(1);
expect(errors[0]).toContain('<= 1000000');
});

it('should reject non-number triage.tokenRecycleLimit', () => {
const errors = validateSingleValue('triage.tokenRecycleLimit', '20000');
expect(errors).toHaveLength(1);
expect(errors[0]).toContain('expected finite number');
});

it('should reject NaN triage.tokenRecycleLimit', () => {
const errors = validateSingleValue('triage.tokenRecycleLimit', NaN);
expect(errors).toHaveLength(1);
expect(errors[0]).toContain('expected finite number');
});

it('should confirm triage schema contains streaming and tokenRecycleLimit properties', () => {
expect(CONFIG_SCHEMA.triage.properties).toHaveProperty('streaming');
expect(CONFIG_SCHEMA.triage.properties.streaming).toEqual({ type: 'boolean' });
expect(CONFIG_SCHEMA.triage.properties).toHaveProperty('tokenRecycleLimit');
expect(CONFIG_SCHEMA.triage.properties.tokenRecycleLimit).toMatchObject({
type: 'number',
min: 0,
max: 1000000,
});
});
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 triage.streaming and triage.tokenRecycleLimit are absent from CONFIG_SCHEMA

The entire describe('triage schema — new fields (streaming, tokenRecycleLimit)', ...) block will fail. In the current src/api/utils/configValidation.js, the triage object's properties map has no streaming or tokenRecycleLimit entries. As a result:

  • validateSingleValue('triage.streaming', true) returns ['Unknown config path: triage.streaming'], not [].
  • Every validateSingleValue('triage.tokenRecycleLimit', ...) call also returns the unknown-path error.
  • CONFIG_SCHEMA.triage.properties.streaming is undefined, so the toHaveProperty / toEqual assertions on lines 530-537 fail.

The schema needs streaming: { type: 'boolean' } and tokenRecycleLimit: { type: 'number', min: 0, max: 1000000 } added to the triage properties before these tests can pass.

Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/api/utils/configValidation.test.js
Line: 486-538

Comment:
**`triage.streaming` and `triage.tokenRecycleLimit` are absent from `CONFIG_SCHEMA`**

The entire `describe('triage schema — new fields (streaming, tokenRecycleLimit)', ...)` block will fail. In the current `src/api/utils/configValidation.js`, the `triage` object's `properties` map has no `streaming` or `tokenRecycleLimit` entries. As a result:

- `validateSingleValue('triage.streaming', true)` returns `['Unknown config path: triage.streaming']`, not `[]`.
- Every `validateSingleValue('triage.tokenRecycleLimit', ...)` call also returns the unknown-path error.
- `CONFIG_SCHEMA.triage.properties.streaming` is `undefined`, so the `toHaveProperty` / `toEqual` assertions on lines 530-537 fail.

The schema needs `streaming: { type: 'boolean' }` and `tokenRecycleLimit: { type: 'number', min: 0, max: 1000000 }` added to the `triage` properties before these tests can pass.

How can I resolve this? If you propose a fix, please make it concise.

@BillChirico BillChirico changed the base branch from main to fix/guild-selector-categories April 18, 2026 23:23
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Volvox.Bot Apr 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants