Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Aug 8, 2025

This PR hardcodes the temperature to 1 for all GPT-5 model variants as requested by @mrubens in #6819.

Changes

  • Modified getModelParams function in src/api/transform/model-params.ts to set temperature to 1 for models starting with "gpt-5"
  • Added comprehensive test coverage for GPT-5 temperature hardcoding

Testing

  • Added 8 new test cases specifically for GPT-5 temperature behavior
  • All existing tests continue to pass
  • Verified that temperature is correctly hardcoded to 1 for:
    • gpt-5-2025-08-07
    • gpt-5-mini-2025-08-07
    • gpt-5-nano-2025-08-07

Context

This change was requested in PR #6819 to ensure consistent behavior for GPT-5 models by always using a temperature of 1, regardless of user settings or defaults.

Fixes: Follow-up to #6819


Important

Hardcodes temperature to 1 for GPT-5 models in getModelParams and adds tests to verify this behavior.

  • Behavior:
    • Hardcodes temperature to 1 for GPT-5 models in getModelParams in model-params.ts.
    • Applies to models starting with "gpt-5" in OpenAI format.
  • Testing:
    • Adds 8 test cases in model-params.spec.ts to verify temperature hardcoding for GPT-5 models.
    • Tests ensure temperature is set to 1 for various GPT-5 model variants and not altered for non-GPT-5 models or non-OpenAI formats.

This description was created by Ellipsis for d8092e3. You can customize this summary. It will automatically update as commits are pushed.

- Set temperature to 1 for all GPT-5 model variants (gpt-5, gpt-5-mini, gpt-5-nano)
- Added comprehensive tests to verify temperature hardcoding
- Ensures consistent behavior for GPT-5 models as requested
@roomote roomote bot requested review from cte, jr and mrubens as code owners August 8, 2025 03:35
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Aug 8, 2025
@roomote roomote bot mentioned this pull request Aug 8, 2025
Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Reviewing my own code is like debugging in a mirror - everything looks backwards but the bugs are still mine.


// Hardcode temperature to 1 for GPT-5 models
if (modelId.startsWith("gpt-5")) {
params.temperature = 1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is the placement after the o1/o3-mini handling intentional? It might be cleaner to group all OpenAI model-specific temperature handling together, perhaps in a separate helper function for better maintainability.

Also, could we add a comment explaining why temperature is hardcoded to 1 for GPT-5 models, similar to lines 143-144 for o1/o3-mini?

})
})

describe("GPT-5 temperature hardcoding", () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great test coverage! Consider adding a test case for potential future GPT-5 variants (e.g., "gpt-5-turbo") to ensure the startsWith("gpt-5") logic handles all GPT-5 family models correctly.

Also, for consistency, the test descriptions could follow a uniform pattern like "hardcodes temperature to 1 for..." and "preserves user temperature for..."

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 8, 2025
@daniel-lxs daniel-lxs closed this Aug 11, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Aug 11, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants