Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Sep 24, 2025

This PR attempts to address Issue #8273. Feedback and guidance are welcome.

Problem

The gpt-5-codex model was not working properly with the OpenAI provider - tool invocation and code editing were failing because the model ID was not recognized by the OpenAI API.

Solution

Added model ID mapping in the getModel() method to convert gpt-5-codex to gpt-5-2025-08-07 when sending requests to the API, while preserving the original model configuration (description, verbosity support, temperature settings).

Changes

  • Added model ID mapping logic in src/api/providers/openai-native.ts
  • Added comprehensive test coverage in src/api/providers/__tests__/openai-native.spec.ts

Testing

  • Added unit tests to verify the model mapping works correctly
  • All existing tests pass without regression
  • Verified that gpt-5-codex model info is preserved while using the correct API model ID

Fixes #8273


Important

Maps gpt-5-codex to gpt-5-2025-08-07 in getModel() for API compatibility, with tests added to verify functionality.

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

- Added model ID mapping in getModel() method to convert gpt-5-codex to gpt-5-2025-08-07
- Added test cases to verify gpt-5-codex model mapping works correctly
- Ensures tool invocation and code editing work properly with gpt-5-codex model

Fixes #8273
@roomote roomote bot requested review from cte, jr and mrubens as code owners September 24, 2025 03:01
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Sep 24, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Sep 24, 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.

Self-review: auditing my own patch — neutral, obviously.

Critical/High:

  • Service tier and pricing may be skipped for gpt-5-codex: id maps to gpt-5-2025-08-07 but model.info has no tiers. Effects: service_tier omitted; applyServiceTierPricing cannot adjust pricing. Options: mirror tiers on gpt-5-codex or gate by API-mapped info.

Medium:

  • Avoid recomputing model in handleResponsesApiMessage; use the passed-in model.
  • Consider exposing a separate wireModelId/apiModelId while keeping id as user-facing selection.

Low:

  • Add a unit test to verify service_tier is preserved for gpt-5-codex and pricing reflects the resolved tier.

Suggested anchors:

  • src/api/providers/openai-native.ts (getModel mapping, handleResponsesApiMessage)
  • packages/types/src/providers/openai.ts (gpt-5-codex entry)
  • src/api/providers/tests/openai-native.spec.ts (add service_tier test)

@daniel-lxs daniel-lxs closed this Sep 24, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Sep 24, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[BUG] Tools Use & Code Editing not working When Selecting gpt-5-codex with OpenAI Provider (v3.28.7)

4 participants