Skip to content

feat(agent-routing): model-only agent routes (set the verifier or any agent's model on the current provider) - #1617

Merged
kevincodex1 merged 6 commits into
Twigpine:mainfrom
beardthelion:feat/per-agent-model-routing
Jun 14, 2026
Merged

kevincodex1 merged 6 commits into
Twigpine:mainfrom
beardthelion:feat/per-agent-model-routing

Conversation

@beardthelion

@beardthelion beardthelion commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Allow agentModels entries to omit base_url/api_key. Such "model-only" entries reuse the current provider's connection and only change the model.
  • Resolve a model-only route as an effective-model change with no provider override, so any agent — in particular the built-in verification auditor — can run on a different model without duplicating endpoint/key. Cross-provider routing is unchanged.

Impact

  • user-facing impact: agentRouting: { "verification": "<key>" } now works with a credential-less entry such as { "mini": { "model": "gpt-5-mini" } } to run the verifier (or any agent) on a different model on your current provider. Full cross-provider entries behave exactly as before. The org model allowlist now also applies to model-only routes.
  • developer/maintainer impact: resolveAgentProvider / resolveAgentModelProvider now return AgentRoute (ProviderOverride | { model }); added an isProviderOverride guard and a shouldEnforceModelAllowlist helper. Out-of-process (pane/window) teammate routing stays cross-provider only.

Testing

  • bun run build
  • bun run smoke
  • bun run check — green except 4 failures in export/lsp/QueryGuard that are pre-existing full-suite pollution: they pass when run in isolation and none reference the routing code touched here.
  • focused tests: bun test src/services/api/agentRouting.test.ts src/utils/settings/agentModelsSchema.test.ts src/tools/AgentTool/ → 87 pass / 0 fail; bun run typecheck clean.

Notes

  • provider/model path tested: a model-only route resolves to the current provider with no OpenAI-shim env override applied; cross-provider routing is regression-covered and unchanged.
  • screenshots attached (if UI changed): n/a, no UI change.
  • follow-up work or known limitations: out-of-process teammates support cross-provider routes only; model-only routing for teammates could be a follow-up.

Summary by CodeRabbit

  • New Features
    • Added support for “model-only” agent routing, allowing agents to switch models while reusing the current provider configuration by specifying only the model in routing settings.
  • Improvements
    • Updated model allowlist enforcement to use the effective routed model (not just whether a provider override exists).
    • Enhanced settings validation and documentation for agentModels, including clearer cross-provider versus model-only configuration examples.
  • Tests
    • Expanded routing and settings schema test coverage for model-only scenarios and allowlist enforcement behavior.

@coderabbitai

coderabbitai Bot commented Jun 14, 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 Plus

Run ID: 3c3d97a6-6df5-45be-8129-b5dce4c5bee9

📥 Commits

Reviewing files that changed from the base of the PR and between 3882ec4 and dc9d510.

📒 Files selected for processing (1)
  • src/services/api/agentRouting.test.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: typecheck
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx,js,jsx,py}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{ts,tsx,js,jsx,py}: Follow the existing code style in the touched files
Keep comments useful and concise

Files:

  • src/services/api/agentRouting.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Typecheck TypeScript code before submitting (use bun run typecheck)

Files:

  • src/services/api/agentRouting.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/services/api/agentRouting.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/services/api/agentRouting.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/services/api/agentRouting.test.ts
**

⚙️ CodeRabbit configuration file

**: # Contributing to OpenClaude

Thanks for contributing.

OpenClaude is a fast-moving open-source coding-agent CLI with support for multiple providers, local backends, MCP, and a terminal-first workflow. The best contributions here are focused, well-tested, and easy to review.

Before You Start

  • Search existing issues and discussions before opening a new thread.
  • Check open pull requests for work that overlaps with your contribution. If a PR already exists that addresses the same change, open an issue or discussion first to align on direction — duplicate PRs may be closed without review.
  • Use issues for confirmed bugs and actionable feature work.
  • Use discussions for setup help, ideas, and general community conversation.
  • For larger changes, open an issue first so the scope is clear before implementation.
  • For security reports, follow SECURITY.md.

Pull Requests

Every PR needs a reason. Your PR description must include:

  • what changed and why
  • the user or developer impact
  • the exact checks you ran
  • a linked issue when one exists, using Fixes fix: skip assertMinVersion for third-party providers #123, `Closes `#123, or another clear link
  • screenshots when the PR touches UI, terminal presentation, or the VS Code extension
  • which provider path was tested when the PR changes provider behavior

The PR author is responsible for ensuring their PR is merge-ready. PRs with merge conflicts will not be reviewed or approved until the conflicts are resolved.

Issues are the recommended starting point for anything non-trivial — opening one first helps avoid wasted effort if the change is out of scope or already being worked on. Small fixes, doc corrections, and obvious improvements can stand on their own without a linked issue, as long as the PR description explains the intent.

What Gets Closed Without Review

PRs may be closed without review...

Files:

  • src/services/api/agentRouting.test.ts
🔇 Additional comments (1)
src/services/api/agentRouting.test.ts (1)

1-591: LGTM!

The test suite comprehensively covers model-only routing, enforcement logic, and warning validation. Console.error spying is properly implemented to prevent CI noise while still asserting expected warnings. Tests validate user-visible behavior, provide good regression coverage, and maintain proper isolation.

Optional improvement: Consider adding a symmetric partial-entry test case (api_key without base_url) alongside the existing base_url-without-api_key test at lines 217-223 for completeness, though both follow the same code path.


📝 Walkthrough

Walkthrough

Agent routing is refactored to support a new "model-only" route shape (AgentModelOnly) alongside the existing full cross-provider override (ProviderOverride), unified under the AgentRoute union type. base_url and api_key become optional in the settings schema, shouldEnforceModelAllowlist replaces the previous providerOverride-only guard, and the feature is documented in the README.

Changes

Agent Model-Only Routing

Layer / File(s) Summary
AgentRoute types and settings schema
src/services/api/agentRouting.ts, src/utils/settings/types.ts
Adds AgentModelOnly, AgentRoute union type, and isProviderOverride type guard. Makes base_url and api_key optional in the agentModels schema to allow model-only route entries that reuse the current provider.
toAgentRoute, resolver functions, shouldEnforceModelAllowlist
src/services/api/agentRouting.ts
Replaces toProviderOverride with toAgentRoute, which returns a model-only route when credentials are absent and warns/skips partial credential entries. Updates resolveAgentProvider, resolveAgentModelProvider, and resolveAgentRunModelRouting to produce/consume AgentRoute. Adds shouldEnforceModelAllowlist logic (`hasProviderOverride
runAgent allowlist enforcement
src/tools/AgentTool/runAgent.ts
Imports and calls shouldEnforceModelAllowlist to decide whether to enforce the model allowlist, replacing the prior providerOverride-only gate.
Tests and documentation
src/services/api/agentRouting.test.ts, src/utils/settings/agentModelsSchema.test.ts, README.md
Adds model-only route and shouldEnforceModelAllowlist test suites (with console.error spies for warning validation), schema validation tests for agentModels, and README documentation describing model-only routes with a verification agent example.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Gitlawb/openclaude#1546: Modifies agentRouting.ts and the agentModels settings schema with overlapping changes to routing key resolution and api_key handling.

Suggested reviewers

  • jatmn
  • kevincodex1
🚥 Pre-merge checks | ✅ 5 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% 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 PR modifies credential/provider routing (base_url/api_key now optional), but PR review does not explicitly disclose the risk surface or state whether this is a blocker. Add to PR description: explicit acknowledgment that this touches auth/provider routing, statement that it's non-blocking (implementation is sound), and note that credential validation prevents misconfigurations.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title concisely describes the main feature (model-only agent routes) and its user-facing benefit (setting agent models on current provider).
Description check ✅ Passed Description covers summary, impact (user/developer), testing status, and notes; all required sections present with substantive detail.
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 Policy changes are explicitly documented: (1) trust-model change—model allowlist enforcement extended to model-only routes (stated in PR description); (2) routing-default change—agents can run on d...

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@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/services/api/agentRouting.test.ts`:
- Around line 172-200: The tests in the 'model-only routes' describe block
intentionally trigger misconfiguration warnings (console.error) when
resolveAgentProvider is called with incomplete agentModels entries like 'bare'
(missing model) and 'half-entry' (missing api_key). Stub console.error using
jest.spyOn at the start of the describe block and restore it in an afterEach
hook. For each test that triggers a warning (bare entry defaults the model and
partial entry skipped), add an assertion using
expect(console.error).toHaveBeenCalled() with the expected warning message to
verify the warning was issued. This silences the console noise in CI logs while
still verifying that the expected warnings are being triggered.
🪄 Autofix (Beta)

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 Plus

Run ID: fad587e2-9c30-463b-914c-4fadd3a5caa8

📥 Commits

Reviewing files that changed from the base of the PR and between a3a3c36 and b914017.

📒 Files selected for processing (6)
  • README.md
  • src/services/api/agentRouting.test.ts
  • src/services/api/agentRouting.ts
  • src/tools/AgentTool/runAgent.ts
  • src/utils/settings/agentModelsSchema.test.ts
  • src/utils/settings/types.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (8)
**/*

⚙️ 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:

  • README.md
  • src/tools/AgentTool/runAgent.ts
  • src/services/api/agentRouting.test.ts
  • src/utils/settings/types.ts
  • src/utils/settings/agentModelsSchema.test.ts
  • src/services/api/agentRouting.ts
{README.md,CONTRIBUTING.md,docs/**,.github/pull_request_template.md}

⚙️ CodeRabbit configuration file

{README.md,CONTRIBUTING.md,docs/**,.github/pull_request_template.md}: Review docs for accuracy against current code behavior. Flag security or provider claims that overpromise, stale install commands, missing setup caveats, and instructions that could push users toward unsafe credential handling. Keep purely wording-level suggestions non-blocking.

Files:

  • README.md
**

⚙️ CodeRabbit configuration file

**: # Contributing to OpenClaude

Thanks for contributing.

OpenClaude is a fast-moving open-source coding-agent CLI with support for multiple providers, local backends, MCP, and a terminal-first workflow. The best contributions here are focused, well-tested, and easy to review.

Before You Start

  • Search existing issues and discussions before opening a new thread.
  • Check open pull requests for work that overlaps with your contribution. If a PR already exists that addresses the same change, open an issue or discussion first to align on direction — duplicate PRs may be closed without review.
  • Use issues for confirmed bugs and actionable feature work.
  • Use discussions for setup help, ideas, and general community conversation.
  • For larger changes, open an issue first so the scope is clear before implementation.
  • For security reports, follow SECURITY.md.

Pull Requests

Every PR needs a reason. Your PR description must include:

  • what changed and why
  • the user or developer impact
  • the exact checks you ran
  • a linked issue when one exists, using Fixes #123, `Closes `#123, or another clear link
  • screenshots when the PR touches UI, terminal presentation, or the VS Code extension
  • which provider path was tested when the PR changes provider behavior

The PR author is responsible for ensuring their PR is merge-ready. PRs with merge conflicts will not be reviewed or approved until the conflicts are resolved.

Issues are the recommended starting point for anything non-trivial — opening one first helps avoid wasted effort if the change is out of scope or already being worked on. Small fixes, doc corrections, and obvious improvements can stand on their own without a linked issue, as long as the PR description explains the intent.

What Gets Closed Without Review

PRs may be closed without review...

Files:

  • README.md
  • src/tools/AgentTool/runAgent.ts
  • src/services/api/agentRouting.test.ts
  • src/utils/settings/types.ts
  • src/utils/settings/agentModelsSchema.test.ts
  • src/services/api/agentRouting.ts
**/*.{ts,tsx,js,jsx,py}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{ts,tsx,js,jsx,py}: Follow the existing code style in the touched files
Keep comments useful and concise

Files:

  • src/tools/AgentTool/runAgent.ts
  • src/services/api/agentRouting.test.ts
  • src/utils/settings/types.ts
  • src/utils/settings/agentModelsSchema.test.ts
  • src/services/api/agentRouting.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Typecheck TypeScript code before submitting (use bun run typecheck)

Files:

  • src/tools/AgentTool/runAgent.ts
  • src/services/api/agentRouting.test.ts
  • src/utils/settings/types.ts
  • src/utils/settings/agentModelsSchema.test.ts
  • src/services/api/agentRouting.ts
src/{components/permissions,utils/permissions,hooks/toolPermission,tools,entrypoints/sdk}/**

⚙️ CodeRabbit configuration file

src/{components/permissions,utils/permissions,hooks/toolPermission,tools,entrypoints/sdk}/**: Review permission prompts, auto-allow logic, sandbox behavior, SDK permission schemas, shell/PowerShell execution, and background execution paths as security-sensitive. Block on bypasses, unclear trust boundaries, unsafe path handling, missing user visibility, or changes that broaden allowed behavior without an explicit maintainer decision.

Files:

  • src/tools/AgentTool/runAgent.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/services/api/agentRouting.test.ts
  • src/services/api/agentRouting.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/services/api/agentRouting.test.ts
  • src/utils/settings/agentModelsSchema.test.ts
🪛 GitHub Actions: PR Checks / 2_smoke-and-tests.txt
src/services/api/agentRouting.test.ts

[warning] 1-1: [agentRouting] Warning: agentModels entry "zai" has only one of base_url/api_key; both are required for cross-provider routing. Skipping this route.


[warning] 1-1: [agentRouting] Warning: agentModels entry "half-entry" has only one of base_url/api_key; both are required for cross-provider routing. Skipping this route.

🪛 LanguageTool
README.md

[style] ~256-~256: Consider using “who” when you are referring to a person instead of an object.
Context: ...: verification (the read-only auditor that runs before completion), Explore, and...

(THAT_WHO)

Comment thread src/services/api/agentRouting.test.ts

@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 one test-cleanliness issue that should be addressed before this is ready.

Findings

  • [P3] Complete CodeRabbit's request to assert the expected routing warning
    src/services/api/agentRouting.test.ts:197
    CodeRabbit's review item is still valid for the intentional partial agentModels case: this test calls resolveAgentProvider() with only base_url, which emits the expected console.error warning during CI. Please complete that request by stubbing the warning and asserting the expected message in the test, so intentional log noise does not mask new routing warnings or failures in future runs.

Silence the intentional console.error noise from partial agentModels
entries in CI logs by stubbing console.error per describe block and
asserting the expected warning message fires, so future routing
warnings or failures are not masked.
@beardthelion

Copy link
Copy Markdown
Contributor Author

Addressed in 3882ec4. The partial-entry tests now stub console.error and assert the expected routing warning, so the intentional log noise no longer leaks into CI and a future unexpected warning won't be masked.

@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/services/api/agentRouting.test.ts (1)

580-580: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Move import to top with other imports.

The shouldEnforceModelAllowlist import belongs at the top of the file (line 1–11 block) alongside the other imports from ./agentRouting.js. This placement breaks the existing file organization pattern.

📦 Proposed fix

Move line 580 to the import block at the top:

 import {
   applyAgentProviderOverrideToEnv,
   isProviderOverride,
   resolveAgentModelProvider,
   resolveAgentProvider,
   resolveAgentRunModelRouting,
   resolveOutOfProcessTeammateProvider,
   resolveOutOfProcessTeammateProviderFromCliArgs,
+  shouldEnforceModelAllowlist,
 } from './agentRouting.js'

Then remove the duplicate import at line 580.

🤖 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/services/api/agentRouting.test.ts` at line 580, The import of
shouldEnforceModelAllowlist from './agentRouting.js' at line 580 violates the
file organization pattern. Move this import to the top of the file (lines 1-11
block) and consolidate it with the existing imports from './agentRouting.js'
that are already declared there. Remove the duplicate import statement that
currently appears at line 580.
🤖 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/services/api/agentRouting.test.ts`:
- Line 580: The import of shouldEnforceModelAllowlist from './agentRouting.js'
at line 580 violates the file organization pattern. Move this import to the top
of the file (lines 1-11 block) and consolidate it with the existing imports from
'./agentRouting.js' that are already declared there. Remove the duplicate import
statement that currently appears at line 580.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 371d6b78-0174-46c0-a2d2-3d8a9b295da3

📥 Commits

Reviewing files that changed from the base of the PR and between b914017 and 3882ec4.

📒 Files selected for processing (1)
  • src/services/api/agentRouting.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: typecheck
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx,js,jsx,py}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{ts,tsx,js,jsx,py}: Follow the existing code style in the touched files
Keep comments useful and concise

Files:

  • src/services/api/agentRouting.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Typecheck TypeScript code before submitting (use bun run typecheck)

Files:

  • src/services/api/agentRouting.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/services/api/agentRouting.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/services/api/agentRouting.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/services/api/agentRouting.test.ts
**

⚙️ CodeRabbit configuration file

**: # Contributing to OpenClaude

Thanks for contributing.

OpenClaude is a fast-moving open-source coding-agent CLI with support for multiple providers, local backends, MCP, and a terminal-first workflow. The best contributions here are focused, well-tested, and easy to review.

Before You Start

  • Search existing issues and discussions before opening a new thread.
  • Check open pull requests for work that overlaps with your contribution. If a PR already exists that addresses the same change, open an issue or discussion first to align on direction — duplicate PRs may be closed without review.
  • Use issues for confirmed bugs and actionable feature work.
  • Use discussions for setup help, ideas, and general community conversation.
  • For larger changes, open an issue first so the scope is clear before implementation.
  • For security reports, follow SECURITY.md.

Pull Requests

Every PR needs a reason. Your PR description must include:

  • what changed and why
  • the user or developer impact
  • the exact checks you ran
  • a linked issue when one exists, using Fixes #123, `Closes `#123, or another clear link
  • screenshots when the PR touches UI, terminal presentation, or the VS Code extension
  • which provider path was tested when the PR changes provider behavior

The PR author is responsible for ensuring their PR is merge-ready. PRs with merge conflicts will not be reviewed or approved until the conflicts are resolved.

Issues are the recommended starting point for anything non-trivial — opening one first helps avoid wasted effort if the change is out of scope or already being worked on. Small fixes, doc corrections, and obvious improvements can stand on their own without a linked issue, as long as the PR description explains the intent.

What Gets Closed Without Review

PRs may be closed without review...

Files:

  • src/services/api/agentRouting.test.ts
🔇 Additional comments (5)
src/services/api/agentRouting.test.ts (5)

1-1: LGTM!


27-33: LGTM!


176-178: LGTM!


183-242: LGTM!


582-592: LGTM!

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 14, 2026
Move the import to the top import block instead of mid-file.

@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.

Thanks for the update. I rechecked the previously discussed paths and do not see any remaining actionable issues from my side.

@kevincodex1 LGTM

@kevincodex1
kevincodex1 merged commit 9e902db into Twigpine:main Jun 14, 2026
4 checks passed
deagwon97 pushed a commit to deagwon97/openclaude that referenced this pull request Jun 15, 2026
… agent's model on the current provider) (Twigpine#1617)

* feat(agent-routing): allow model-only agentModels entries in settings schema

* feat(agent-routing): resolve model-only agent routes that reuse the current provider

* feat(agent-routing): enforce org model allowlist for model-only agent routes

* docs(agent-routing): document model-only routes and built-in agent keys

* test(agent-routing): stub and assert partial-entry routing warnings

Silence the intentional console.error noise from partial agentModels
entries in CI logs by stubbing console.error per describe block and
asserting the expected warning message fires, so future routing
warnings or failures are not masked.

* test(agent-routing): consolidate shouldEnforceModelAllowlist import

Move the import to the top import block instead of mid-file.
hotmanxp added a commit to hotmanxp/openclaude that referenced this pull request Jun 16, 2026
Cherry-picked from upstream 9e902db. Adds model-only agent route
support: instead of 'agentName:provider' you can now use
'agentName:model' to route a sub-agent to a different model on the
SAME provider (e.g. Explore=sonnet, Plan=opus).

- New resolveAgentRunModelRouting helper
- Extended AgentModelConfig type to allow { model } without provider override
- agentModelsSchema zod validation
- README update skipped (OC maintains own README)

Includes 46 new tests in agentRouting.test.ts + agentModelsSchema.test.ts.
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