Skip to content

fix: improve NewAPI routing and capability overlays - #1708

Merged
zerob13 merged 2 commits into
devfrom
fix/new-api-provider-db-capabilities
May 31, 2026
Merged

fix: improve NewAPI routing and capability overlays#1708
zerob13 merged 2 commits into
devfrom
fix/new-api-provider-db-capabilities

Conversation

@yyhhyyyyyy

@yyhhyyyyyy yyhhyyyyyy commented May 31, 2026

Copy link
Copy Markdown
Collaborator
  • Fix NewAPI endpoint selection when supported_endpoint_types is empty or stale by using owned_by, model family, and Provider DB hints for Anthropic/Gemini fallback inference.
  • Separate NewAPI request endpoint routing from Provider DB capability ownership, so OpenAI-compatible models can still use vendor-specific capability metadata.
  • Preserve owned_by as ownedBy model metadata and persist inferred endpointType / ownedBy in provider-managed model config.
  • Improve capability overlays for AI SDK routes and NewAPI models, including reasoning, temperature, vision, and function-call metadata.
  • Refresh Provider DB / ACP registry assets and add coverage for route inference, capability matching, and UI capability controls.

Summary by CodeRabbit

  • New Features

    • Added Grok Build agent support to the registry.
  • Improvements

    • Updated registered agent versions and distribution references across multiple platforms.
    • Enhanced temperature and top-P parameter controls to intelligently respect model capabilities.
    • Improved model capability detection and matching logic across providers.
    • Added model ownership metadata tracking for better model identification.

@coderabbitai

coderabbitai Bot commented May 31, 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7eb06a13-818d-4603-901e-517417f6f39c

📥 Commits

Reviewing files that changed from the base of the PR and between 7004f99 and 958ea24.

⛔ Files ignored due to path filters (1)
  • resources/acp-registry/icons/grok-build.svg is excluded by !**/*.svg
📒 Files selected for processing (23)
  • resources/acp-registry/registry.json
  • resources/model-db/providers.json
  • src/main/presenter/configPresenter/index.ts
  • src/main/presenter/configPresenter/modelCapabilities.ts
  • src/main/presenter/configPresenter/modelConfig.ts
  • src/main/presenter/configPresenter/providerModelHelper.ts
  • src/main/presenter/llmProviderPresenter/aiSdk/runtime.ts
  • src/main/presenter/llmProviderPresenter/managers/modelManager.ts
  • src/main/presenter/llmProviderPresenter/providers/aiSdkProvider.ts
  • src/renderer/src/components/chat/ChatStatusBar.vue
  • src/renderer/src/components/settings/ModelConfigDialog.vue
  • src/renderer/src/stores/modelStore.ts
  • src/shared/contracts/common.ts
  • src/shared/contracts/domainSchemas.ts
  • src/shared/model.ts
  • src/shared/types/presenters/legacy.presenters.d.ts
  • src/shared/types/presenters/llmprovider.presenter.d.ts
  • test/main/presenter/configPresenter/modelCapabilities.test.ts
  • test/main/presenter/llmProviderPresenter/aiSdkRuntime.test.ts
  • test/main/presenter/llmProviderPresenter/newApiProvider.test.ts
  • test/main/shared/model.test.ts
  • test/renderer/components/ChatStatusBar.test.ts
  • test/renderer/components/ModelConfigDialog.test.ts

📝 Walkthrough

Walkthrough

This PR adds model ownership metadata (ownedBy) throughout the system and refactors model capability matching for better provider/model-id resolution. These improvements enable New API routing to infer endpoint types from ownership hints and gate sampling controls (topP) based on capability support. Agent registry entries are updated with version bumps and a new grok-build entry is added.

Changes

Model ownership and capability-aware routing

Layer / File(s) Summary
Type contracts and schema foundations
src/shared/types/presenters/legacy.presenters.d.ts, src/shared/types/presenters/llmprovider.presenter.d.ts, src/shared/contracts/common.ts, src/shared/contracts/domainSchemas.ts
Added optional ownedBy?: string field to ModelConfig, RENDERER_MODEL_META, MODEL_META, and ProviderModelSummarySchema to track model ownership across type definitions and validation schemas.
Ownership metadata propagation
src/main/presenter/configPresenter/modelConfig.ts, src/main/presenter/configPresenter/providerModelHelper.ts, src/main/presenter/configPresenter/index.ts, src/main/presenter/llmProviderPresenter/managers/modelManager.ts, src/renderer/src/stores/modelStore.ts
Propagate ownedBy from model configs through config presenters, provider helpers, and renderer store; normalize and merge ownership metadata at model resolution points.
Model capability matching refactor
src/main/presenter/configPresenter/modelCapabilities.ts, test/main/presenter/configPresenter/modelCapabilities.test.ts
Refactor capability matching to normalize provider/model identifiers and build a canonical modelLookupIndex for faster cross-provider resolution. Add three new public APIs: getCapabilityModel, getCapabilityModelMatch, and findCapabilityModelMatch. Change temperature-support fallback to default true instead of Claude-Opus-specific logic.
New API endpoint inference and model metadata
src/shared/model.ts, src/main/presenter/llmProviderPresenter/providers/aiSdkProvider.ts, test/main/shared/model.test.ts, test/main/presenter/llmProviderPresenter/newApiProvider.test.ts
Extend NewApiRouteMeta with ownedBy and capabilityProviderId fields. Add helpers to infer special endpoint types (anthropic/gemini) from ownership and resolve runtime capability provider IDs. Parse owned_by from models and enrich metadata with capability-derived properties (vision, reasoning, function-call); group models by ownership.
Runtime sampling control (topP)
src/main/presenter/llmProviderPresenter/aiSdk/runtime.ts, src/renderer/src/components/chat/ChatStatusBar.vue, src/renderer/src/components/settings/ModelConfigDialog.vue, test/main/presenter/llmProviderPresenter/aiSdkRuntime.test.ts, test/renderer/components/ChatStatusBar.test.ts, test/renderer/components/ModelConfigDialog.test.ts
Conditionally resolve topP at runtime based on provider capability (Anthropic reuses temperature-control check). Update runAiSdkGenerateText and streaming paths to omit topP when unsupported. Add supportsTopPControl and showTopPControl computed properties to Vue components to conditionally gate topP UI controls.

Agent registry maintenance

Layer / File(s) Summary
Agent version bumps and distributions
resources/acp-registry/registry.json
Update version numbers and platform-specific binary archive URLs or npx/uvx package references for 20+ registered agents (Amp, Auggie CLI, Claude Agent, Cline, Codebuddy Code, Codex CLI, crow-cli, DimCode, Factory Droid, fast-agent, Gemini CLI, GitHub Copilot, Goose, Kilo, Kimi CLI, Mistral Vibe, Nova, OpenCode, Poolside, Qwen Code, siGit Code).
New grok-build agent entry
resources/acp-registry/registry.json
Register a new grok-build ("Grok Build") agent with version, description, authors, and platform-specific binary distribution configuration plus icon.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • ThinkInAIXYZ/deepchat#1479: Extends temperature capability gating logic introduced in that PR to also gate topP control for Anthropic models.
  • ThinkInAIXYZ/deepchat#1443: Builds on New API provider/routing feature to add ownership-based endpoint inference and capability-driven model metadata.
  • ThinkInAIXYZ/deepchat#971: Modifies the same modelCapabilities.ts module to add canonical lookup-based capability matching APIs.

Suggested reviewers

  • zerob13

Poem

🐰 With whiskers twitching at metadata's bloom,
We hop through the ownedBy rooms,
Where capabilities match and topP takes flight—
New API routes glow anthropic-bright,
And Grok builds hop into the registry's night! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main focus of the PR: improving NewAPI routing and capability overlays through enhanced endpoint selection, ownership metadata propagation, and capability-driven model metadata.
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/new-api-provider-db-capabilities

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@zerob13
zerob13 merged commit 8b4e0f6 into dev May 31, 2026
3 checks passed
@zhangmo8
zhangmo8 deleted the fix/new-api-provider-db-capabilities branch June 1, 2026 06:52
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.

2 participants