Skip to content

Conversation

@yyhhyyyyyy
Copy link
Collaborator

@yyhhyyyyyy yyhhyyyyyy commented Oct 10, 2025

add reasoning/search defaults

Summary by CodeRabbit

  • New Features
    • Reasoning and Web Search now honor provider-defined default settings.
    • Capability detection now reads official model fields for tool calls, reasoning, and search.
    • Models expose an optional “default” flag for reasoning and search, improving default toggles.
    • More consistent feature availability when selecting provider models.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 10, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Updates provider model schemas to include optional default flags for reasoning and search, propagates those defaults from the provider DB sanitization, and adjusts presenter mappings to read display name, tool_call, and the new default-based reasoning/search flags when building model configs.

Changes

Cohort / File(s) Summary of changes
Presenter: DB model mapping
src/main/presenter/configPresenter/index.ts
Use m.display_name for model name; read tool_call, reasoning?.supported, and search?.supported directly from model (remove casts).
Presenter: config defaults
src/main/presenter/configPresenter/modelConfig.ts
Derive reasoning and enableSearch from provider.model.reasoning.default ?? false and provider.model.search.default ?? false instead of .supported.
Schema: provider model types
src/shared/types/model-db.ts
Add optional default: boolean to ReasoningSchema and SearchSchema; getReasoning/getSearch parse/emit default, widening ProviderModel.reasoning and ProviderModel.search.
Provider DB sanitization
scripts/fetch-provider-db.mjs
Propagate default boolean for reasoning and search when sanitizing provider entries (copy r.defaultrs.default, s.defaultso.default).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant UI as UI
  participant CP as ConfigPresenter
  participant S as Sanitizer (fetch-provider-db)
  participant DB as Provider DB

  UI->>CP: Request provider model config
  CP->>S: Ask for sanitized provider models
  S->>DB: Read raw provider JSON
  DB-->>S: Raw models (may include reasoning.default/search.default)
  S-->>CP: Sanitized ProviderModel { display_name, tool_call, reasoning?, search? }

  rect rgba(200,235,255,0.25)
    note right of CP: Mapping & defaults
    CP->>CP: name = model.display_name
    CP->>CP: functionCall = model.tool_call
    CP->>CP: reasoning.supported = model.reasoning?.supported
    CP->>CP: reasoning.default = model.reasoning?.default ?? false
    CP->>CP: search.supported = model.search?.supported
    CP->>CP: search.default = model.search?.default ?? false
    CP->>UI: finalConfig (reasoning/search derive from `.default`)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

Possibly related PRs

Poem

I nibble defaults in moonlit code,
Flags tucked safe along the road.
Reasoning, search—now gently sown,
Clean names and fields all neatly known.
A rabbit cheers: hops, stamps, and grins—🐇✨

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title concisely and accurately describes the primary change by indicating that default values for reasoning and search are being added to the provider database logic, matching the modifications across configPresenter, model config, types, and scripts.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/providerdb-defaults

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b220973 and 44ce3ca.

📒 Files selected for processing (1)
  • scripts/fetch-provider-db.mjs (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
scripts/**

📄 CodeRabbit inference engine (AGENTS.md)

Place build/signing/installer/runtime and commit-related scripts in scripts/

Files:

  • scripts/fetch-provider-db.mjs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-check (x64)
🔇 Additional comments (2)
scripts/fetch-provider-db.mjs (2)

68-68: LGTM! Consistent with existing pattern.

The propagation of the default flag for reasoning is correctly implemented, mirroring the pattern used for the supported flag on line 67. The type check ensures only boolean values are copied.


88-88: LGTM! Consistent with existing pattern.

The propagation of the default flag for search is correctly implemented, mirroring the pattern used for the supported flag on line 87. The type check ensures only boolean values are copied.


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.

@yyhhyyyyyy
Copy link
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link

To use Codex here, create a Codex account and connect to github.

@zerob13
Copy link
Collaborator

zerob13 commented Oct 10, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment on lines 293 to 300
temperature: 0.6,
vision: isImageInputSupported(model),
functionCall: model.tool_call ?? false,
reasoning: Boolean(model.reasoning?.supported),
reasoning: Boolean(model.reasoning?.default ?? false),
type: ModelType.Chat,
thinkingBudget: model.reasoning?.budget?.default ?? undefined,
enableSearch: Boolean(model.search?.supported),
enableSearch: Boolean(model.search?.default ?? false),
forcedSearch: Boolean(model.search?.forced_search),

Choose a reason for hiding this comment

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

P1 Badge Restore fallback when reasoning/search default missing

ModelConfigHelper now initializes reasoning and enableSearch from model.reasoning?.default and model.search?.default. The provider database currently contains no default flags for these capabilities (e.g. rg -c '"default"' resources/model-db/providers.json only yields budget defaults), so both fields evaluate to false for every model even when supported is true. This regresses prior behavior where supported reasoning/search were enabled by default and effectively disables those features until the user toggles them manually. Consider falling back to the supported flag when default is undefined.

Useful? React with 👍 / 👎.

@zerob13
Copy link
Collaborator

zerob13 commented Oct 10, 2025

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Swish!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

@zerob13 zerob13 merged commit 5ab257e into dev Oct 10, 2025
2 checks passed
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