Skip to content

Config: Remove the Temperature for GPT-5 Models while Config Versioning - #910

Merged
Ayush8923 merged 3 commits into
mainfrom
fix/config-version
Jun 4, 2026
Merged

Config: Remove the Temperature for GPT-5 Models while Config Versioning#910
Ayush8923 merged 3 commits into
mainfrom
fix/config-version

Conversation

@Ayush8923

@Ayush8923Ayush8923 commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Issue: ProjectTech4DevAI/kaapi-frontend#189

Summary

  • Remove the temperature parameter for GPT-5 models when updating an existing configuration and migrating it to a configuration that uses a GPT-5 family model.

Checklist

Before submitting a pull request, please ensure that you mark these task.

  • Ran fastapi run --reload app/main.py or docker compose up in the repository root and test.
  • If you've fixed a bug or added code that is tested and has test cases.

@coderabbitai

coderabbitaiBot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • ready-for-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d87e10be-7de1-4235-9d53-fdb560208ee0

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR adds parameter validation to config version creation by stripping unsupported completion parameters for reasoning models with non-native providers. A new _strip_unsupported_params helper removes the temperature parameter from merged config when appropriate, and is called during config update processing.

Changes

Reasoning Model Parameter Handling

Layer / File(s)Summary
Parameter stripping for non-native reasoning models
backend/app/crud/config/version.py
is_reasoning_model is imported and a new _strip_unsupported_params helper is added to remove temperature from completion params when the model is a reasoning model and the provider is not *-native. The helper is called in create_or_raise after config merging but before validation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • ProjectTech4DevAI/kaapi-backend#717: Both PRs change how the temperature completion parameter is included/removed from outgoing LLM-related payloads (main PR strips it for unsupported reasoning-model/provider combos; retrieved PR omits it unless explicitly set/required).

Suggested labels

enhancement

Poem

🐰 A reasoning model hops into view,
Temperature stripped—unsupported, too.
Native providers stay cozy and warm,
While configs adapt to each model's true form.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title directly refers to the main change: removing temperature parameter for GPT-5 models during config versioning, matching the primary code modification.
Docstring Coverage✅ PassedDocstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck 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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/config-version

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.

@github-actions

github-actionsBot commented Jun 4, 2026

Copy link
Copy Markdown

OpenAPI changes ⚪ No API surface changes

Note

This PR does not modify the API contract.

main82db647e · generated by oasdiff

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown

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 `@backend/app/crud/config/version.py`:
- Around line 159-179: _strip_unsupported_params mutates the nested params dict
in-place (params.pop("temperature")), which can modify structures still shared
by _deep_merge/create_or_raise and latest_version.config_blob; to fix, ensure
you operate on a copy before mutating: when reading completion =
merged_config.get("completion") and params = completion.get("params"), replace
the nested params in merged_config with a shallow/deep copy (e.g., dict(params)
or copy.deepcopy(params)) and mutate that copy (remove "temperature") so the
original shared object isn't changed; reference functions/_methods:
_strip_unsupported_params, _deep_merge, create_or_raise, and
latest_version.config_blob to locate where to copy and where to assign back.
🪄 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: CHILL

Plan: Pro

Run ID: 593392d5-a554-42b3-afbe-01d81a04b8af

📥 Commits

Reviewing files that changed from the base of the PR and between 901517d and 76dc7dd.

📒 Files selected for processing (1)
  • backend/app/crud/config/version.py

Comment threadbackend/app/crud/config/version.py
@sentry

sentryBot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Ayush8923
Ayush8923 merged commit 4204823 into mainJun 4, 2026
4 checks passed
@Ayush8923
Ayush8923 deleted the fix/config-version branch June 4, 2026 12:08
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.2.0-main.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@Ayush8923@Prajna1999@vprashrex