Conversation
|
Automated review 🤖 Summary of Changes Key Changes & Positives
Potential Issues & Recommendations
Language/Framework Checks
Security & Privacy
Build/CI & Ops
Tests
Approval Recommendation
|
There was a problem hiding this comment.
Pull request overview
Updates the OpenAI Chat Completions parameter mapping to be GPT‑5-family aware, introducing explicit reasoning/verbosity controls and model-specific capability rules.
Changes:
- Add
reasoningEffortandverbositytoGenerateParamsand plumb them through base param mapping. - Implement a centralized GPT‑5 support table (
getGpt5Support) and updateOpenAIMapperto enforce/normalize GPT‑5 Chat Completions behavior (sampling, reasoning, verbosity, unsupported variants). - Expand unit tests to cover GPT‑5 / GPT‑5.2 / dated variants / unsupported variants / unknown future variants.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/core/mapping/openai.mapper.spec.ts | Adds test coverage for GPT‑5-family normalization and rejection behavior in Chat Completions mapping. |
| src/types/params.types.ts | Introduces ReasoningEffort / Verbosity types and exposes them on GenerateParams. |
| src/core/rosetta-ai.ts | Adds DEBUG-only logging of mapped Anthropic stream requests. |
| src/core/mapping/openai.mapper.ts | Implements GPT‑5 capability-aware mapping (reasoning, verbosity, sampling, unsupported model rejection). |
| src/core/mapping/gpt5.support.ts | New GPT‑5 capability table + exact/prefix lookup helper used by the OpenAI mapper. |
| src/core/mapping/common.utils.ts | Extends mapBaseParams to carry reasoningEffort and verbosity. |
| package.json | Bumps package version to 1.12.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| const mappedParams = mapper.mapToProviderParams ? mapper.mapToProviderParams(effectiveParams) : effectiveParams | ||
|
|
||
| if (process.env.DEBUG === 'true' && providerKey === Provider.Anthropic) { | ||
| console.log(`[ROSETTA DEBUG] Mapped Anthropic stream request:\n${JSON.stringify(mappedParams, null, 2)}`) |
| expect(result.top_p).toBe(0.9) | ||
| }) | ||
|
|
||
| it('[Medium] should drop sampling and default reasoning for gpt-5', () => { |
| if (process.env.DEBUG === 'true' && providerKey === Provider.Anthropic) { | ||
| console.log(`[ROSETTA DEBUG] Mapped Anthropic stream request:\n${JSON.stringify(mappedParams, null, 2)}`) | ||
| } |
| const mappedParams = mapper.mapToProviderParams ? mapper.mapToProviderParams(effectiveParams) : effectiveParams | ||
|
|
||
| if (process.env.DEBUG === 'true' && providerKey === Provider.Anthropic) { | ||
| console.log(`[ROSETTA DEBUG] Mapped Anthropic stream request:\n${JSON.stringify(mappedParams, null, 2)}`) |
No description provided.