Repository navigation
Preserve supported Responses behavior in Chat translation - #7894
diegosouzapw merged 8 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c51853d063
ℹ️ 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 "@codex address that feedback".
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f7a47ffe4
ℹ️ 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 "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0135d01b2c
ℹ️ 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 "@codex address that feedback".
| const identity = toolIdentity(tool); | ||
| if (identity && seen.has(identity)) continue; | ||
| if (identity) seen.add(identity); | ||
| merged.push(tool); |
There was a problem hiding this comment.
Deduplicate flattened function names
When an additional_tools namespace contains a subtool whose name also appears as a top-level function (or in a differently named namespace), these raw identities are distinct and both entries survive collection. The subsequent Chat conversion flattens namespaces, producing duplicate function.name values; unlike Gemini's sanitizer, direct OpenAI-compatible and Claude paths forward duplicate tools, which strict upstreams reject. Deduplicate after namespace flattening (while retaining top-level precedence) rather than only by the namespace container identity.
Useful? React with 👍 / 👎.
4f52e36
into
cheaper-inference:release/v3.8.49
|
Merged — thanks @JxnLexn! Making the Responses→Chat downgrade loss-aware (merging both tool-declaration sources) is a real correctness win for that translation path. Validated in the local merge-train (combined tree, full unit suite + vitest green) on tomni-proxmox-113 @ 998752fbca then squash-merged. |
…ference#7894) * fix(responses): preserve additional_tools when downgrading to Chat Completions * fix: preserve Responses structured output in Chat translation * fix: translate Responses allowed tools to Chat * fix: reject unsupported Responses input items * fix: normalize Responses refusal history for Chat * fix: strip Responses-only fields from Chat requests * fix: preserve namespace tools with colliding function names * fix: merge same-named namespaces during Chat translation
…ference#7894) * fix(responses): preserve additional_tools when downgrading to Chat Completions * fix: preserve Responses structured output in Chat translation * fix: translate Responses allowed tools to Chat * fix: reject unsupported Responses input items * fix: normalize Responses refusal history for Chat * fix: strip Responses-only fields from Chat requests * fix: preserve namespace tools with colliding function names * fix: merge same-named namespaces during Chat translation
Summary
Validation
npm run lintnpm run test:unitnpm run test:coverage>= 60%for statements, lines, functions, and branchesTests Added Or Updated
Coverage Notes
Reviewer Notes
allowed_toolsvalidation, particularly for namespaced tools and strict Chat-compatible endpoints.