Skip to content

feat(opengateway): add Ling 3.0 Tiny :free — Day-0 launch, free until August 13 - #2112

Merged
kevincodex1 merged 8 commits into
mainfrom
feat/ling-tiny-free
Aug 11, 2026
Merged

kevincodex1 merged 8 commits into
mainfrom
feat/ling-tiny-free

Conversation

@kevincodex1

@kevincodex1 kevincodex1 commented Aug 11, 2026 •

Copy link
Copy Markdown
Member

inclusionai/ling-3.0-tiny:free (7.9B MoE, ~1.3B active, 262k ctx) joins the picker via the gateway's OpenRouter wiring. The gateway time-boxes it (free through Aug 13, rate limited) and delists it server-side when the window closes.

Summary by CodeRabbit

  • New Features

    • Added support for the free Ling 3.0 Tiny model.
    • Enabled chat, reasoning, coding, streaming, and function-calling capabilities.
    • Added a 262K-token context window and 32K-token output limit.
    • Available through August 13, 2026, subject to rate limits.
  • Improvements

    • Automatically hides expired, hidden, or unavailable models from selection and default recommendations.
    • Preserves models with malformed availability dates rather than removing them unexpectedly.
    • Improves fallback selection when catalog models are unavailable.

… Aug 13

inclusionai/ling-3.0-tiny:free (7.9B MoE, ~1.3B active, 262k ctx)
joins the picker via the gateway's OpenRouter wiring. The gateway
time-boxes it (free through Aug 13, rate limited) and delists it
server-side when the window closes.
@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 697e887c-6062-45af-9d3e-83f69ff1ac2d

📥 Commits

Reviewing files that changed from the base of the PR and between 3e2835b and a94b675.

📒 Files selected for processing (1)
  • src/integrations/routeMetadata.test.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: smoke-and-tests (24.11.x)
  • GitHub Check: smoke-and-tests (22)
  • GitHub Check: typecheck
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript strict mode and ESM imports throughout the source code.

Run bun run typecheck and bun run typecheck:type-tests for TypeScript changes when applicable.

Files:

  • src/integrations/routeMetadata.test.ts
**/*.{tsx,ts}

📄 CodeRabbit inference engine (AGENTS.md)

Use React and Ink patterns for terminal UI components.

Files:

  • src/integrations/routeMetadata.test.ts
src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.ts: Prefer existing service, provider, settings, permission, and UI patterns over introducing new abstractions.
Use chalk for terminal color and execa for child-process execution when those capabilities are needed.

Files:

  • src/integrations/routeMetadata.test.ts
**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Add or update tests when behavior changes, and run the narrowest useful focused test checks.

Files:

  • src/integrations/routeMetadata.test.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not add new Python code, Python provider paths, or Python dependencies without explicit maintainer approval.

**/*.{ts,tsx,js,jsx}: Follow the existing code style in touched source files, prefer small readable changes, avoid unrelated reformatting, and keep comments useful and concise.
Preserve existing repository patterns unless intentionally refactoring them, and avoid broad rewrites or unnecessary generated changes.
Review AI-assisted code for correctness, style consistency, unnecessary changes, and adherence to project architecture before submitting it.

Files:

  • src/integrations/routeMetadata.test.ts
**/*.{test,spec}.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{test,spec}.{ts,tsx,js,jsx}: Add or update tests when a code change affects behavior.
Use focused tests such as bun test ./path/to/test-file.test.ts when validating a narrowly scoped change.

Files:

  • src/integrations/routeMetadata.test.ts
**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update documentation when setup, commands, or user-facing behavior changes.

Files:

  • src/integrations/routeMetadata.test.ts

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/integrations/routeMetadata.test.ts
{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}

⚙️ CodeRabbit configuration file

{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}: Review provider routing, model selection, env precedence, auth/token handling, OpenAI-compatible shims, retries, proxy behavior, and outbound HTTP behavior with high scrutiny. Block on silent default changes, hidden fallback expansion, credential reuse mistakes, hardcoded provider assumptions, or new network reach that is not intentional and documented.

Files:

  • src/integrations/routeMetadata.test.ts
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/integrations/routeMetadata.test.ts
🔇 Additional comments (2)
src/integrations/routeMetadata.test.ts (2)

15-20: LGTM!

Also applies to: 751-811


751-811: 📐 Maintainability & Code Quality

Run the required checks in an environment with Bun installed.

The focused test, both typechecks, and the build did not run because bun is unavailable.


📝 Walkthrough

Walkthrough

The PR registers inclusionai/ling-3.0-tiny:free with model metadata, brand registration, gateway routing, picker discovery, and tests. It also adds expiry-based catalog filtering for route resolution and model selection.

Changes

Ling 3.0 Tiny Free Model

Layer / File(s) Summary
Model definition and gateway catalog
src/integrations/models/ling.ts, src/integrations/brands/ling.ts, src/integrations/gateways/gitlawb-opengateway.ts, src/integrations/ling-tiny.test.ts
Defines model capabilities, token limits, brand registration, gateway routing, lifecycle metadata, rate-limit metadata, and availability-window tests.
Catalog availability filtering
src/integrations/descriptors.ts, src/integrations/registry.ts, src/integrations/registry.test.ts, src/integrations/index.ts, src/integrations/routeMetadata.ts, src/integrations/routeMetadata.test.ts
Adds optional availableUntil metadata and filters hidden or expired entries while preserving malformed timestamps, gateway-first resolution, and route default fallback behavior.
Picker integration and validation
src/commands/model/model.tsx, src/commands/model/model.test.tsx, src/utils/model/routeCatalogOptions.test.ts
Filters static and cached catalog entries after merge. Tests verify active and expired model behavior, duplicate handling, static-entry precedence, and deterministic time boundaries.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: jatmn

🚥 Pre-merge checks | ✅ 4 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description provides a brief summary but omits the required Impact, Testing, and Notes sections and does not document test results. Add the required template sections, including user and maintainer impact, completed testing, provider/model path, screenshots status, and known limitations or follow-up work.
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Risk Surface Disclosed ⚠️ Warning The CodeRabbit walkthrough explicitly warns that the OpenRouter gateway route risk surface and blocker status are not disclosed; reviews remain CHANGES_REQUESTED. Add a review note covering provider routing and outbound OpenRouter behavior, and explicitly state whether the change has a blocking issue.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise, scoped to the OpenGateway change, and accurately states the Ling 3.0 Tiny launch and expiration window.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No Hidden Policy Change ✅ Passed The diff adds the stated Ling model and explicit expiry guard; existing gateway auth, base URL, transport, usage, and default model remain unchanged, with no telemetry or permission changes.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ling-tiny-free

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/commands/model/model.test.tsx`:
- Line 1452: Add a focused integration assertion in the model picker tests
covering opengateway-ling-3.0-tiny-free, verifying that both apiName and
modelDescriptorId resolve to inclusionai/ling-3.0-tiny:free, rather than only
checking descriptor inclusion.

In `@src/integrations/gateways/gitlawb-opengateway.ts`:
- Around line 157-166: Update the catalog entry identified by
opengateway-ling-3.0-tiny-free so it is hidden or expires after August 13, 2026,
using the existing integration lifecycle-guard pattern. Clarify its notes to
state “Free through August 13, 2026 (rate limited)” and ensure the picker cannot
expose it after the cutoff; alternatively remove it before that date and add the
corresponding boundary regression test.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 65558c70-4fbe-4e8d-9b9d-59416d2b0986

📥 Commits

Reviewing files that changed from the base of the PR and between 54b9cd8 and 8fef811.

📒 Files selected for processing (4)
  • src/commands/model/model.test.tsx
  • src/integrations/brands/ling.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/models/ling.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: smoke-and-tests (24.11.x)
  • GitHub Check: smoke-and-tests (22)
  • GitHub Check: typecheck
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript strict mode and ESM imports throughout the source code.

Run bun run typecheck and bun run typecheck:type-tests for TypeScript changes when applicable.

Files:

  • src/integrations/models/ling.ts
  • src/integrations/brands/ling.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/commands/model/model.test.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (AGENTS.md)

Use React and Ink patterns for terminal UI components.

Files:

  • src/integrations/models/ling.ts
  • src/integrations/brands/ling.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/commands/model/model.test.tsx
src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.ts: Prefer existing service, provider, settings, permission, and UI patterns over introducing new abstractions.
Use chalk for terminal color and execa for child-process execution when those capabilities are needed.

Files:

  • src/integrations/models/ling.ts
  • src/integrations/brands/ling.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not add new Python code, Python provider paths, or Python dependencies without explicit maintainer approval.

**/*.{ts,tsx,js,jsx}: Follow the existing code style in touched source files, prefer small readable changes, avoid unrelated reformatting, and keep comments useful and concise.
Preserve existing repository patterns unless intentionally refactoring them, and avoid broad rewrites or unnecessary generated changes.
Review AI-assisted code for correctness, style consistency, unnecessary changes, and adherence to project architecture before submitting it.

Files:

  • src/integrations/models/ling.ts
  • src/integrations/brands/ling.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/commands/model/model.test.tsx
**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update documentation when setup, commands, or user-facing behavior changes.

Files:

  • src/integrations/models/ling.ts
  • src/integrations/brands/ling.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/commands/model/model.test.tsx

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/integrations/models/ling.ts
  • src/integrations/brands/ling.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/commands/model/model.test.tsx
{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}

⚙️ CodeRabbit configuration file

{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}: Review provider routing, model selection, env precedence, auth/token handling, OpenAI-compatible shims, retries, proxy behavior, and outbound HTTP behavior with high scrutiny. Block on silent default changes, hidden fallback expansion, credential reuse mistakes, hardcoded provider assumptions, or new network reach that is not intentional and documented.

Files:

  • src/integrations/models/ling.ts
  • src/integrations/brands/ling.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Add or update tests when behavior changes, and run the narrowest useful focused test checks.

Files:

  • src/commands/model/model.test.tsx
**/*.{test,spec}.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{test,spec}.{ts,tsx,js,jsx}: Add or update tests when a code change affects behavior.
Use focused tests such as bun test ./path/to/test-file.test.ts when validating a narrowly scoped change.

Files:

  • src/commands/model/model.test.tsx
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/commands/model/model.test.tsx
🔇 Additional comments (2)
src/integrations/models/ling.ts (1)

22-39: LGTM!

src/integrations/brands/ling.ts (1)

15-15: LGTM!

Comment thread src/commands/model/model.test.tsx Outdated
Comment thread src/integrations/gateways/gitlawb-opengateway.ts Outdated
Addresses CodeRabbit review on #2112:
- new ling-tiny.test.ts (macaron.test.ts pattern) asserting the
  opengateway-ling-3.0-tiny-free entry maps both apiName and
  modelDescriptorId to inclusionai/ling-3.0-tiny:free, plus descriptor
  capabilities and runtime limits
- catalog note now dated explicitly ('Free through August 13, 2026')
  and the entry's lifecycle documented: the gateway time-boxes the id
  server-side and 400s after the window; this static catalog has no
  expiry mechanism (Ling Flash precedent), so the entry is removed or
  updated at window close
@kevincodex1

Copy link
Copy Markdown
Member Author

@coderabbitai please do a full code review again

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

@kevincodex1 I will perform a full review of PR #2112.

✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/integrations/gateways/gitlawb-opengateway.ts`:
- Around line 157-170: The static catalog entry opengateway-ling-3.0-tiny-free
needs lifecycle enforcement after its August 13, 2026 cutoff. Add a guard in the
catalog construction or model-selection flow that hides/removes this entry at
expiry, reusing the gateway’s existing expiry source if available, and add a
boundary regression test covering the cutoff while preserving visibility before
it.

In `@src/integrations/ling-tiny.test.ts`:
- Around line 21-27: Update the capability assertion in the focused Ling test to
include supportsPreciseTokenCount and verify it is false, matching the provider
definition in ling.ts so future capability changes fail the regression test.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6c9b6441-5dc1-47cc-85e2-806c852bb681

📥 Commits

Reviewing files that changed from the base of the PR and between 54b9cd8 and f805975.

📒 Files selected for processing (5)
  • src/commands/model/model.test.tsx
  • src/integrations/brands/ling.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/ling-tiny.test.ts
  • src/integrations/models/ling.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript strict mode and ESM imports throughout the source code.

Run bun run typecheck and bun run typecheck:type-tests for TypeScript changes when applicable.

Files:

  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/brands/ling.ts
  • src/commands/model/model.test.tsx
  • src/integrations/models/ling.ts
  • src/integrations/ling-tiny.test.ts
**/*.{tsx,ts}

📄 CodeRabbit inference engine (AGENTS.md)

Use React and Ink patterns for terminal UI components.

Files:

  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/brands/ling.ts
  • src/commands/model/model.test.tsx
  • src/integrations/models/ling.ts
  • src/integrations/ling-tiny.test.ts
src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.ts: Prefer existing service, provider, settings, permission, and UI patterns over introducing new abstractions.
Use chalk for terminal color and execa for child-process execution when those capabilities are needed.

Files:

  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/brands/ling.ts
  • src/integrations/models/ling.ts
  • src/integrations/ling-tiny.test.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not add new Python code, Python provider paths, or Python dependencies without explicit maintainer approval.

**/*.{ts,tsx,js,jsx}: Follow the existing code style in touched source files, prefer small readable changes, avoid unrelated reformatting, and keep comments useful and concise.
Preserve existing repository patterns unless intentionally refactoring them, and avoid broad rewrites or unnecessary generated changes.
Review AI-assisted code for correctness, style consistency, unnecessary changes, and adherence to project architecture before submitting it.

Files:

  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/brands/ling.ts
  • src/commands/model/model.test.tsx
  • src/integrations/models/ling.ts
  • src/integrations/ling-tiny.test.ts
**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update documentation when setup, commands, or user-facing behavior changes.

Files:

  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/brands/ling.ts
  • src/commands/model/model.test.tsx
  • src/integrations/models/ling.ts
  • src/integrations/ling-tiny.test.ts

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/brands/ling.ts
  • src/commands/model/model.test.tsx
  • src/integrations/models/ling.ts
  • src/integrations/ling-tiny.test.ts
{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}

⚙️ CodeRabbit configuration file

{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}: Review provider routing, model selection, env precedence, auth/token handling, OpenAI-compatible shims, retries, proxy behavior, and outbound HTTP behavior with high scrutiny. Block on silent default changes, hidden fallback expansion, credential reuse mistakes, hardcoded provider assumptions, or new network reach that is not intentional and documented.

Files:

  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/brands/ling.ts
  • src/integrations/models/ling.ts
  • src/integrations/ling-tiny.test.ts
**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Add or update tests when behavior changes, and run the narrowest useful focused test checks.

Files:

  • src/commands/model/model.test.tsx
  • src/integrations/ling-tiny.test.ts
**/*.{test,spec}.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{test,spec}.{ts,tsx,js,jsx}: Add or update tests when a code change affects behavior.
Use focused tests such as bun test ./path/to/test-file.test.ts when validating a narrowly scoped change.

Files:

  • src/commands/model/model.test.tsx
  • src/integrations/ling-tiny.test.ts
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/commands/model/model.test.tsx
  • src/integrations/ling-tiny.test.ts
🔇 Additional comments (4)
src/integrations/models/ling.ts (1)

22-39: LGTM!

src/integrations/brands/ling.ts (1)

15-15: LGTM!

src/commands/model/model.test.tsx (1)

1452-1452: LGTM!

src/integrations/ling-tiny.test.ts (1)

10-48: 🗄️ Data Integrity & Integration

Run the focused checks in an environment with Bun installed.

All four commands fail because bun is not found.

Comment thread src/integrations/gateways/gitlawb-opengateway.ts
Comment thread src/integrations/ling-tiny.test.ts
…cle guard

Addresses CodeRabbit round 2 on #2112:
- new optional ModelCatalogEntry.availableUntil (ISO-8601): entries past
  the cutoff are dropped in getCatalogEntriesForRoute, the single choke
  point behind the model picker, gateway catalogs, and runtime limits;
  the pre-existing (previously unenforced) hidden flag is honored in the
  same filter; unparseable dates fail open
- the Ling Tiny entry sets availableUntil to the gateway's window end
  (2026-08-13T10:00:00Z), so the picker drops it the instant the
  gateway starts rejecting the id — no client release needed
- boundary regression test on both sides of the cutoff, and the picker
  expected-list test pins the clock inside the window (setSystemTime)
  so it stays deterministic after the date passes
- ling-tiny.test.ts now also asserts supportsPreciseTokenCount: false

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/integrations/gateways/gitlawb-opengateway.ts`:
- Around line 170-174: Update the lifecycle comment immediately preceding
availableUntil in the gateway catalog entry to state that availableUntil serves
as the lifecycle/expiry guard and controls when the picker stops offering the
entry; remove the outdated claim that expiry requires manual catalog removal,
while preserving the existing server-side window synchronization guidance.

In `@src/integrations/ling-tiny.test.ts`:
- Around line 13-14: Add an exact-cutoff fixture for 2026-08-13T10:00:00Z in the
availability tests, and extend registry tests around the relevant registry
behavior to cover hidden entries and malformed availableUntil values. Run the
focused Bun tests and required typechecks, then document the exact commands used
in the PR.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 45a2f001-7b9b-4e73-af59-a9476d1645e2

📥 Commits

Reviewing files that changed from the base of the PR and between f805975 and 7c0d6bf.

📒 Files selected for processing (5)
  • src/commands/model/model.test.tsx
  • src/integrations/descriptors.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/ling-tiny.test.ts
  • src/integrations/registry.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript strict mode and ESM imports throughout the source code.

Run bun run typecheck and bun run typecheck:type-tests for TypeScript changes when applicable.

Files:

  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/ling-tiny.test.ts
  • src/integrations/descriptors.ts
  • src/commands/model/model.test.tsx
  • src/integrations/registry.ts
**/*.{tsx,ts}

📄 CodeRabbit inference engine (AGENTS.md)

Use React and Ink patterns for terminal UI components.

Files:

  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/ling-tiny.test.ts
  • src/integrations/descriptors.ts
  • src/commands/model/model.test.tsx
  • src/integrations/registry.ts
src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.ts: Prefer existing service, provider, settings, permission, and UI patterns over introducing new abstractions.
Use chalk for terminal color and execa for child-process execution when those capabilities are needed.

Files:

  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/ling-tiny.test.ts
  • src/integrations/descriptors.ts
  • src/integrations/registry.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not add new Python code, Python provider paths, or Python dependencies without explicit maintainer approval.

**/*.{ts,tsx,js,jsx}: Follow the existing code style in touched source files, prefer small readable changes, avoid unrelated reformatting, and keep comments useful and concise.
Preserve existing repository patterns unless intentionally refactoring them, and avoid broad rewrites or unnecessary generated changes.
Review AI-assisted code for correctness, style consistency, unnecessary changes, and adherence to project architecture before submitting it.

Files:

  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/ling-tiny.test.ts
  • src/integrations/descriptors.ts
  • src/commands/model/model.test.tsx
  • src/integrations/registry.ts
**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update documentation when setup, commands, or user-facing behavior changes.

Files:

  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/ling-tiny.test.ts
  • src/integrations/descriptors.ts
  • src/commands/model/model.test.tsx
  • src/integrations/registry.ts

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/ling-tiny.test.ts
  • src/integrations/descriptors.ts
  • src/commands/model/model.test.tsx
  • src/integrations/registry.ts
{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}

⚙️ CodeRabbit configuration file

{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}: Review provider routing, model selection, env precedence, auth/token handling, OpenAI-compatible shims, retries, proxy behavior, and outbound HTTP behavior with high scrutiny. Block on silent default changes, hidden fallback expansion, credential reuse mistakes, hardcoded provider assumptions, or new network reach that is not intentional and documented.

Files:

  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/ling-tiny.test.ts
  • src/integrations/descriptors.ts
  • src/integrations/registry.ts
**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Add or update tests when behavior changes, and run the narrowest useful focused test checks.

Files:

  • src/integrations/ling-tiny.test.ts
  • src/commands/model/model.test.tsx
**/*.{test,spec}.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{test,spec}.{ts,tsx,js,jsx}: Add or update tests when a code change affects behavior.
Use focused tests such as bun test ./path/to/test-file.test.ts when validating a narrowly scoped change.

Files:

  • src/integrations/ling-tiny.test.ts
  • src/commands/model/model.test.tsx
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/integrations/ling-tiny.test.ts
  • src/commands/model/model.test.tsx
🔇 Additional comments (4)
src/integrations/descriptors.ts (1)

117-124: LGTM!

src/integrations/registry.ts (1)

166-189: LGTM!

src/integrations/ling-tiny.test.ts (1)

10-12: LGTM!

Also applies to: 33-57

src/commands/model/model.test.tsx (1)

3-3: LGTM!

Also applies to: 1432-1467

Comment thread src/integrations/gateways/gitlawb-opengateway.ts Outdated
Comment thread src/integrations/ling-tiny.test.ts
…fix stale lifecycle comment

Addresses CodeRabbit round 3 on #2112:
- ling-tiny.test.ts asserts the boundary at exactly 2026-08-13T10:00:00Z
  (cutoff is exclusive: entry already gone at that instant)
- registry.test.ts covers the two previously-untested filter branches:
  hidden entries dropped, availableUntil expiry (before / at / after
  cutoff), and a malformed availableUntil failing open
- the catalog comment above the Ling Tiny entry no longer claims the
  static catalog has no expiry mechanism — availableUntil is the guard

Validation commands run locally:
  bun run integrations:generate
  bun test src/integrations src/commands/model/model.test.tsx src/utils/model
  bunx tsc --noEmit
558 tests pass, typecheck clean.

@jatmn jatmn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I found issues that need to be addressed before this is ready.

Findings

  • [P1] Route static picker entries through the availability filter
    src/commands/model/model.tsx:460
    The direct catalog.models access predates this change, but this PR makes it actionable by adding a time-limited static entry while putting the new availableUntil/hidden check only in getCatalogEntriesForRoute(). Consequently, once 2026-08-13T10:00:00Z passes, opening /model on Gitlawb Opengateway still offers inclusionai/ling-3.0-tiny:free; selecting it persists and sends the model ID that this PR documents the gateway will reject with a 400. The changed picker test freezes time inside the availability window, so it cannot detect this path. Source the static entries from the filtered catalog helper (and preserve that filtering when static entries are merged with discovery results), then add an at/after-cutoff picker regression test.

Addresses jatmn's P1 on #2112: model.tsx read catalog.models directly,
bypassing the availableUntil/hidden filter that only lived in
getCatalogEntriesForRoute — so after 2026-08-13T10:00Z the /model
picker would still offer inclusionai/ling-3.0-tiny:free and selecting
it would persist an id the gateway 400s.

- registry.ts exports filterAvailableCatalogEntries (shared with
  getCatalogEntriesForRoute)
- model.tsx filters the static entries AND the static+discovery merged
  list, so discovery-sourced entries with their own markers are covered
- routeMetadata.ts getRouteDefaultModel's catalog fallback filters too,
  so an expired entry can never become the implicit default
- new picker regression test pinned just past the cutoff asserts the
  expired entry is gone while the rest of the catalog is untouched

Validation: bun run integrations:generate; bun test src/integrations
src/commands/model/model.test.tsx src/utils/model (559 pass); bunx tsc
--noEmit (clean).

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/commands/model/model.tsx (1)

461-512: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Preserve static availability metadata during discovery merges.

If cached discovery returns an expired or hidden static apiName without availability metadata, filtering before mergeRouteCatalogEntries allows the cached entry to bypass the cutoff. Merge unfiltered catalog entries first, then filter the merged result. Keep filtered entries for the no-discovery path. Add a duplicate-cache regression test and run the specified test and typecheck commands.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/commands/model/model.tsx` around lines 461 - 512, The discovery path must
preserve static availability metadata when merging cached models. In
src/commands/model/model.tsx lines 461-512, keep filtered static entries for the
no-discovery path, but merge the unfiltered catalog.models entries with cached
results before applying filterAvailableCatalogEntries to the merged result. In
src/commands/model/model.test.tsx lines 1471-1519, add a regression test where
cached discovery returns a duplicate static apiName without availability
metadata and verify the expired or hidden entry remains excluded; run the
specified test and typecheck commands.

Sources: Coding guidelines, Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/commands/model/model.tsx`:
- Around line 461-512: The discovery path must preserve static availability
metadata when merging cached models. In src/commands/model/model.tsx lines
461-512, keep filtered static entries for the no-discovery path, but merge the
unfiltered catalog.models entries with cached results before applying
filterAvailableCatalogEntries to the merged result. In
src/commands/model/model.test.tsx lines 1471-1519, add a regression test where
cached discovery returns a duplicate static apiName without availability
metadata and verify the expired or hidden entry remains excluded; run the
specified test and typecheck commands.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 22668e1d-ca7c-47f6-ba76-b63fe64a2daf

📥 Commits

Reviewing files that changed from the base of the PR and between 88174af and 9e3ac02.

📒 Files selected for processing (5)
  • src/commands/model/model.test.tsx
  • src/commands/model/model.tsx
  • src/integrations/index.ts
  • src/integrations/registry.ts
  • src/integrations/routeMetadata.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript strict mode and ESM imports throughout the source code.

Run bun run typecheck and bun run typecheck:type-tests for TypeScript changes when applicable.

Files:

  • src/commands/model/model.tsx
  • src/integrations/index.ts
  • src/integrations/routeMetadata.ts
  • src/commands/model/model.test.tsx
  • src/integrations/registry.ts
**/*.{tsx,ts}

📄 CodeRabbit inference engine (AGENTS.md)

Use React and Ink patterns for terminal UI components.

Files:

  • src/commands/model/model.tsx
  • src/integrations/index.ts
  • src/integrations/routeMetadata.ts
  • src/commands/model/model.test.tsx
  • src/integrations/registry.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not add new Python code, Python provider paths, or Python dependencies without explicit maintainer approval.

**/*.{ts,tsx,js,jsx}: Follow the existing code style in touched source files, prefer small readable changes, avoid unrelated reformatting, and keep comments useful and concise.
Preserve existing repository patterns unless intentionally refactoring them, and avoid broad rewrites or unnecessary generated changes.
Review AI-assisted code for correctness, style consistency, unnecessary changes, and adherence to project architecture before submitting it.

Files:

  • src/commands/model/model.tsx
  • src/integrations/index.ts
  • src/integrations/routeMetadata.ts
  • src/commands/model/model.test.tsx
  • src/integrations/registry.ts
**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update documentation when setup, commands, or user-facing behavior changes.

Files:

  • src/commands/model/model.tsx
  • src/integrations/index.ts
  • src/integrations/routeMetadata.ts
  • src/commands/model/model.test.tsx
  • src/integrations/registry.ts

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/commands/model/model.tsx
  • src/integrations/index.ts
  • src/integrations/routeMetadata.ts
  • src/commands/model/model.test.tsx
  • src/integrations/registry.ts
src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.ts: Prefer existing service, provider, settings, permission, and UI patterns over introducing new abstractions.
Use chalk for terminal color and execa for child-process execution when those capabilities are needed.

Files:

  • src/integrations/index.ts
  • src/integrations/routeMetadata.ts
  • src/integrations/registry.ts
{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}

⚙️ CodeRabbit configuration file

{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}: Review provider routing, model selection, env precedence, auth/token handling, OpenAI-compatible shims, retries, proxy behavior, and outbound HTTP behavior with high scrutiny. Block on silent default changes, hidden fallback expansion, credential reuse mistakes, hardcoded provider assumptions, or new network reach that is not intentional and documented.

Files:

  • src/integrations/index.ts
  • src/integrations/routeMetadata.ts
  • src/integrations/registry.ts
**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Add or update tests when behavior changes, and run the narrowest useful focused test checks.

Files:

  • src/commands/model/model.test.tsx
**/*.{test,spec}.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{test,spec}.{ts,tsx,js,jsx}: Add or update tests when a code change affects behavior.
Use focused tests such as bun test ./path/to/test-file.test.ts when validating a narrowly scoped change.

Files:

  • src/commands/model/model.test.tsx
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/commands/model/model.test.tsx
🔇 Additional comments (4)
src/integrations/registry.ts (1)

180-202: LGTM!

src/integrations/index.ts (1)

22-22: LGTM!

Also applies to: 121-121

src/integrations/routeMetadata.ts (1)

9-9: LGTM!

Also applies to: 163-167

src/commands/model/model.tsx (1)

16-16: LGTM!

@kevincodex1

Copy link
Copy Markdown
Member Author

@coderabbitai please do an intensive code review and make sure its all good approve if it is

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

@kevincodex1 I will perform an intensive full review of #2112. I will approve it only if the review finds no blocking issues.

✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/commands/model/model.tsx`:
- Around line 461-465: Preserve the raw static catalog when calling
mergeRouteCatalogEntries so cached discovery entries cannot reintroduce an
expired duplicate; apply filterAvailableCatalogEntries only to the merged
result. Keep staticEntries filtered for the non-discovery path, and add a
deterministic regression test covering a cached duplicate without availableUntil
after the cutoff.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5b81f896-84d2-4e9b-a05c-fd66e494c561

📥 Commits

Reviewing files that changed from the base of the PR and between 54b9cd8 and 9e3ac02.

📒 Files selected for processing (11)
  • src/commands/model/model.test.tsx
  • src/commands/model/model.tsx
  • src/integrations/brands/ling.ts
  • src/integrations/descriptors.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/index.ts
  • src/integrations/ling-tiny.test.ts
  • src/integrations/models/ling.ts
  • src/integrations/registry.test.ts
  • src/integrations/registry.ts
  • src/integrations/routeMetadata.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript strict mode and ESM imports throughout the source code.

Run bun run typecheck and bun run typecheck:type-tests for TypeScript changes when applicable.

Files:

  • src/integrations/registry.test.ts
  • src/integrations/routeMetadata.ts
  • src/integrations/descriptors.ts
  • src/integrations/brands/ling.ts
  • src/integrations/models/ling.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/ling-tiny.test.ts
  • src/commands/model/model.test.tsx
  • src/integrations/registry.ts
  • src/integrations/index.ts
  • src/commands/model/model.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (AGENTS.md)

Use React and Ink patterns for terminal UI components.

Files:

  • src/integrations/registry.test.ts
  • src/integrations/routeMetadata.ts
  • src/integrations/descriptors.ts
  • src/integrations/brands/ling.ts
  • src/integrations/models/ling.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/ling-tiny.test.ts
  • src/commands/model/model.test.tsx
  • src/integrations/registry.ts
  • src/integrations/index.ts
  • src/commands/model/model.tsx
src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.ts: Prefer existing service, provider, settings, permission, and UI patterns over introducing new abstractions.
Use chalk for terminal color and execa for child-process execution when those capabilities are needed.

Files:

  • src/integrations/registry.test.ts
  • src/integrations/routeMetadata.ts
  • src/integrations/descriptors.ts
  • src/integrations/brands/ling.ts
  • src/integrations/models/ling.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/ling-tiny.test.ts
  • src/integrations/registry.ts
  • src/integrations/index.ts
**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Add or update tests when behavior changes, and run the narrowest useful focused test checks.

Files:

  • src/integrations/registry.test.ts
  • src/integrations/ling-tiny.test.ts
  • src/commands/model/model.test.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not add new Python code, Python provider paths, or Python dependencies without explicit maintainer approval.

**/*.{ts,tsx,js,jsx}: Follow the existing code style in touched source files, prefer small readable changes, avoid unrelated reformatting, and keep comments useful and concise.
Preserve existing repository patterns unless intentionally refactoring them, and avoid broad rewrites or unnecessary generated changes.
Review AI-assisted code for correctness, style consistency, unnecessary changes, and adherence to project architecture before submitting it.

Files:

  • src/integrations/registry.test.ts
  • src/integrations/routeMetadata.ts
  • src/integrations/descriptors.ts
  • src/integrations/brands/ling.ts
  • src/integrations/models/ling.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/ling-tiny.test.ts
  • src/commands/model/model.test.tsx
  • src/integrations/registry.ts
  • src/integrations/index.ts
  • src/commands/model/model.tsx
**/*.{test,spec}.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{test,spec}.{ts,tsx,js,jsx}: Add or update tests when a code change affects behavior.
Use focused tests such as bun test ./path/to/test-file.test.ts when validating a narrowly scoped change.

Files:

  • src/integrations/registry.test.ts
  • src/integrations/ling-tiny.test.ts
  • src/commands/model/model.test.tsx
**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update documentation when setup, commands, or user-facing behavior changes.

Files:

  • src/integrations/registry.test.ts
  • src/integrations/routeMetadata.ts
  • src/integrations/descriptors.ts
  • src/integrations/brands/ling.ts
  • src/integrations/models/ling.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/ling-tiny.test.ts
  • src/commands/model/model.test.tsx
  • src/integrations/registry.ts
  • src/integrations/index.ts
  • src/commands/model/model.tsx

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/integrations/registry.test.ts
  • src/integrations/routeMetadata.ts
  • src/integrations/descriptors.ts
  • src/integrations/brands/ling.ts
  • src/integrations/models/ling.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/ling-tiny.test.ts
  • src/commands/model/model.test.tsx
  • src/integrations/registry.ts
  • src/integrations/index.ts
  • src/commands/model/model.tsx
{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}

⚙️ CodeRabbit configuration file

{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}: Review provider routing, model selection, env precedence, auth/token handling, OpenAI-compatible shims, retries, proxy behavior, and outbound HTTP behavior with high scrutiny. Block on silent default changes, hidden fallback expansion, credential reuse mistakes, hardcoded provider assumptions, or new network reach that is not intentional and documented.

Files:

  • src/integrations/registry.test.ts
  • src/integrations/routeMetadata.ts
  • src/integrations/descriptors.ts
  • src/integrations/brands/ling.ts
  • src/integrations/models/ling.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/ling-tiny.test.ts
  • src/integrations/registry.ts
  • src/integrations/index.ts
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/integrations/registry.test.ts
  • src/integrations/ling-tiny.test.ts
  • src/commands/model/model.test.tsx
🔇 Additional comments (11)
src/integrations/models/ling.ts (1)

22-39: LGTM!

src/integrations/brands/ling.ts (1)

15-15: LGTM!

src/integrations/gateways/gitlawb-opengateway.ts (1)

157-171: LGTM!

src/integrations/ling-tiny.test.ts (1)

1-77: LGTM!

src/integrations/descriptors.ts (1)

117-124: LGTM!

src/integrations/registry.ts (1)

166-202: LGTM!

src/integrations/registry.test.ts (1)

241-296: LGTM!

src/integrations/index.ts (1)

22-22: LGTM!

Also applies to: 121-121

src/integrations/routeMetadata.ts (1)

9-9: LGTM!

Also applies to: 163-167

src/commands/model/model.tsx (1)

16-16: LGTM!

src/commands/model/model.test.tsx (1)

3-3: LGTM!

Also applies to: 1432-1519

Comment thread src/commands/model/model.tsx Outdated
…icates

Addresses CodeRabbit round 4 on #2112: filtering static entries before
mergeRouteCatalogEntries let a cached discovery entry with the same
apiName (and no availableUntil marker) re-enter the merged list, where
the post-merge filter could not remove it. The merge now takes the RAW
static list — the expired static entry wins the apiName dedup and the
post-merge filter then drops it, so neither copy survives. The filtered
list still drives the non-discovery path.

Regression tests in routeCatalogOptions.test.ts cover the cached
duplicate after the cutoff (including documenting the buggy pre-filter
order) and the masking inside the window.

Validation: bun run integrations:generate; bun test src/integrations
src/commands/model/model.test.tsx src/utils/model (561 pass); bunx tsc
--noEmit (clean).
@kevincodex1

Copy link
Copy Markdown
Member Author

@coderabbitai please do a full review again only approve if its good

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

@kevincodex1 I will perform a full review of #2112. I will approve only if the review finds no blocking issues.

✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/integrations/routeMetadata.ts`:
- Around line 163-167: Add focused coverage in routeMetadata.test.ts for
getRouteDefaultModel: provide catalog entries including one hidden entry and one
whose availableUntil has reached the cutoff, plus a valid entry, and assert the
valid entry is selected as the fallback. Run bun test
./src/integrations/routeMetadata.test.ts and keep the test scoped to
default-model filtering behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b07d0180-5a9a-4d7a-9f19-21c8f137d315

📥 Commits

Reviewing files that changed from the base of the PR and between 54b9cd8 and 90bfcdd.

📒 Files selected for processing (12)
  • src/commands/model/model.test.tsx
  • src/commands/model/model.tsx
  • src/integrations/brands/ling.ts
  • src/integrations/descriptors.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/index.ts
  • src/integrations/ling-tiny.test.ts
  • src/integrations/models/ling.ts
  • src/integrations/registry.test.ts
  • src/integrations/registry.ts
  • src/integrations/routeMetadata.ts
  • src/utils/model/routeCatalogOptions.test.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript strict mode and ESM imports throughout the source code.

Run bun run typecheck and bun run typecheck:type-tests for TypeScript changes when applicable.

Files:

  • src/integrations/registry.test.ts
  • src/integrations/routeMetadata.ts
  • src/commands/model/model.tsx
  • src/integrations/models/ling.ts
  • src/integrations/brands/ling.ts
  • src/utils/model/routeCatalogOptions.test.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/descriptors.ts
  • src/commands/model/model.test.tsx
  • src/integrations/ling-tiny.test.ts
  • src/integrations/registry.ts
  • src/integrations/index.ts
**/*.{tsx,ts}

📄 CodeRabbit inference engine (AGENTS.md)

Use React and Ink patterns for terminal UI components.

Files:

  • src/integrations/registry.test.ts
  • src/integrations/routeMetadata.ts
  • src/commands/model/model.tsx
  • src/integrations/models/ling.ts
  • src/integrations/brands/ling.ts
  • src/utils/model/routeCatalogOptions.test.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/descriptors.ts
  • src/commands/model/model.test.tsx
  • src/integrations/ling-tiny.test.ts
  • src/integrations/registry.ts
  • src/integrations/index.ts
src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.ts: Prefer existing service, provider, settings, permission, and UI patterns over introducing new abstractions.
Use chalk for terminal color and execa for child-process execution when those capabilities are needed.

Files:

  • src/integrations/registry.test.ts
  • src/integrations/routeMetadata.ts
  • src/integrations/models/ling.ts
  • src/integrations/brands/ling.ts
  • src/utils/model/routeCatalogOptions.test.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/descriptors.ts
  • src/integrations/ling-tiny.test.ts
  • src/integrations/registry.ts
  • src/integrations/index.ts
**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Add or update tests when behavior changes, and run the narrowest useful focused test checks.

Files:

  • src/integrations/registry.test.ts
  • src/utils/model/routeCatalogOptions.test.ts
  • src/commands/model/model.test.tsx
  • src/integrations/ling-tiny.test.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not add new Python code, Python provider paths, or Python dependencies without explicit maintainer approval.

**/*.{ts,tsx,js,jsx}: Follow the existing code style in touched source files, prefer small readable changes, avoid unrelated reformatting, and keep comments useful and concise.
Preserve existing repository patterns unless intentionally refactoring them, and avoid broad rewrites or unnecessary generated changes.
Review AI-assisted code for correctness, style consistency, unnecessary changes, and adherence to project architecture before submitting it.

Files:

  • src/integrations/registry.test.ts
  • src/integrations/routeMetadata.ts
  • src/commands/model/model.tsx
  • src/integrations/models/ling.ts
  • src/integrations/brands/ling.ts
  • src/utils/model/routeCatalogOptions.test.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/descriptors.ts
  • src/commands/model/model.test.tsx
  • src/integrations/ling-tiny.test.ts
  • src/integrations/registry.ts
  • src/integrations/index.ts
**/*.{test,spec}.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{test,spec}.{ts,tsx,js,jsx}: Add or update tests when a code change affects behavior.
Use focused tests such as bun test ./path/to/test-file.test.ts when validating a narrowly scoped change.

Files:

  • src/integrations/registry.test.ts
  • src/utils/model/routeCatalogOptions.test.ts
  • src/commands/model/model.test.tsx
  • src/integrations/ling-tiny.test.ts
**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update documentation when setup, commands, or user-facing behavior changes.

Files:

  • src/integrations/registry.test.ts
  • src/integrations/routeMetadata.ts
  • src/commands/model/model.tsx
  • src/integrations/models/ling.ts
  • src/integrations/brands/ling.ts
  • src/utils/model/routeCatalogOptions.test.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/descriptors.ts
  • src/commands/model/model.test.tsx
  • src/integrations/ling-tiny.test.ts
  • src/integrations/registry.ts
  • src/integrations/index.ts

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/integrations/registry.test.ts
  • src/integrations/routeMetadata.ts
  • src/commands/model/model.tsx
  • src/integrations/models/ling.ts
  • src/integrations/brands/ling.ts
  • src/utils/model/routeCatalogOptions.test.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/descriptors.ts
  • src/commands/model/model.test.tsx
  • src/integrations/ling-tiny.test.ts
  • src/integrations/registry.ts
  • src/integrations/index.ts
{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}

⚙️ CodeRabbit configuration file

{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}: Review provider routing, model selection, env precedence, auth/token handling, OpenAI-compatible shims, retries, proxy behavior, and outbound HTTP behavior with high scrutiny. Block on silent default changes, hidden fallback expansion, credential reuse mistakes, hardcoded provider assumptions, or new network reach that is not intentional and documented.

Files:

  • src/integrations/registry.test.ts
  • src/integrations/routeMetadata.ts
  • src/integrations/models/ling.ts
  • src/integrations/brands/ling.ts
  • src/utils/model/routeCatalogOptions.test.ts
  • src/integrations/gateways/gitlawb-opengateway.ts
  • src/integrations/descriptors.ts
  • src/integrations/ling-tiny.test.ts
  • src/integrations/registry.ts
  • src/integrations/index.ts
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/integrations/registry.test.ts
  • src/utils/model/routeCatalogOptions.test.ts
  • src/commands/model/model.test.tsx
  • src/integrations/ling-tiny.test.ts
🔇 Additional comments (1)
src/integrations/descriptors.ts (1)

117-124: 🎯 Functional Correctness

No change needed.

getCatalogEntryForModel calls getCatalogEntriesForRoute, which applies filterAvailableCatalogEntries before runtime-limit lookup.

			> Likely an incorrect or invalid review comment.

Comment thread src/integrations/routeMetadata.ts
…ntries

Addresses CodeRabbit round 5 on #2112: getRouteDefaultModel's catalog
fallback changed in the availability-filter fix but had no focused
coverage. New routeMetadata.test.ts case (self-contained registry
mutation with the shared lock, mirroring registry.test.ts) verifies a
hidden default-marked entry and a past-cutoff availableUntil entry are
both skipped in favor of the remaining valid entry, and that a catalog
with nothing valid yields undefined rather than a rejected id.

Validation: bun test ./src/integrations/routeMetadata.test.ts (63
pass); bun run integrations:generate; bun test src/integrations
src/commands/model/model.test.tsx src/utils/model (562 pass); bunx tsc
--noEmit (clean).

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/integrations/routeMetadata.test.ts`:
- Around line 801-804: Update the finally cleanup around
_clearRegistryForTesting, ensureIntegrationsLoaded, and
releaseSharedMutationLock so the lock release executes even when either
preceding cleanup operation throws. Nest or otherwise structure the cleanup to
guarantee releaseSharedMutationLock runs unconditionally while preserving the
existing cleanup calls.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: fbefa584-2e2a-4af6-a185-0d24490d859b

📥 Commits

Reviewing files that changed from the base of the PR and between 90bfcdd and 3e2835b.

📒 Files selected for processing (1)
  • src/integrations/routeMetadata.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: typecheck
  • GitHub Check: smoke-and-tests (24.11.x)
  • GitHub Check: smoke-and-tests (22)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript strict mode and ESM imports throughout the source code.

Run bun run typecheck and bun run typecheck:type-tests for TypeScript changes when applicable.

Files:

  • src/integrations/routeMetadata.test.ts
**/*.{tsx,ts}

📄 CodeRabbit inference engine (AGENTS.md)

Use React and Ink patterns for terminal UI components.

Files:

  • src/integrations/routeMetadata.test.ts
src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.ts: Prefer existing service, provider, settings, permission, and UI patterns over introducing new abstractions.
Use chalk for terminal color and execa for child-process execution when those capabilities are needed.

Files:

  • src/integrations/routeMetadata.test.ts
**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Add or update tests when behavior changes, and run the narrowest useful focused test checks.

Files:

  • src/integrations/routeMetadata.test.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not add new Python code, Python provider paths, or Python dependencies without explicit maintainer approval.

**/*.{ts,tsx,js,jsx}: Follow the existing code style in touched source files, prefer small readable changes, avoid unrelated reformatting, and keep comments useful and concise.
Preserve existing repository patterns unless intentionally refactoring them, and avoid broad rewrites or unnecessary generated changes.
Review AI-assisted code for correctness, style consistency, unnecessary changes, and adherence to project architecture before submitting it.

Files:

  • src/integrations/routeMetadata.test.ts
**/*.{test,spec}.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{test,spec}.{ts,tsx,js,jsx}: Add or update tests when a code change affects behavior.
Use focused tests such as bun test ./path/to/test-file.test.ts when validating a narrowly scoped change.

Files:

  • src/integrations/routeMetadata.test.ts
**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update documentation when setup, commands, or user-facing behavior changes.

Files:

  • src/integrations/routeMetadata.test.ts

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/integrations/routeMetadata.test.ts
{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}

⚙️ CodeRabbit configuration file

{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}: Review provider routing, model selection, env precedence, auth/token handling, OpenAI-compatible shims, retries, proxy behavior, and outbound HTTP behavior with high scrutiny. Block on silent default changes, hidden fallback expansion, credential reuse mistakes, hardcoded provider assumptions, or new network reach that is not intentional and documented.

Files:

  • src/integrations/routeMetadata.test.ts
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/integrations/routeMetadata.test.ts

Comment thread src/integrations/routeMetadata.test.ts Outdated
…tore throws

Addresses CodeRabbit round 6 on #2112: the fallback test's finally
block ran _clearRegistryForTesting/ensureIntegrationsLoaded before
releaseSharedMutationLock, so a throw there would leave the lock held
and block later tests. Nested try/finally, matching registry.test.ts's
afterEach shape.

Validation: bun test ./src/integrations/routeMetadata.test.ts (63
pass); full related suites 562 pass; tsc clean.
@kevincodex1
kevincodex1 merged commit 7b03ad1 into main Aug 11, 2026
10 checks passed
@kevincodex1
kevincodex1 deleted the feat/ling-tiny-free branch August 11, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants