Repository navigation
Fix Responses tool_choice compatibility for LobeHub - #18
Conversation
Why LobeHub tool-backed generation sends required, which the gateway rejected before contacting a capable upstream. How Accept and preserve auto, none and required through the existing Codex serializers. Cover standard/lite conversion and public HTTP forwarding; retain rejection of unknown choices.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Why: The SDK compatibility suite still expected required to be rejected. How: Cover auto, none and required with function tools and reserve the rejection case for an unknown choice.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 16533e6a74
ℹ️ 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".
| if self | ||
| .tool_choice | ||
| .as_deref() | ||
| .is_some_and(|v| !["auto", "none", "required"].contains(&v)) |
There was a problem hiding this comment.
Update the SDK suite for the newly accepted tool choice
When the sdk job in .github/workflows/image.yml runs cargo test --locked --test gateway actual_ -- --ignored, actual_openai_sdk_compatibility_suite executes test_compatibility.py::test_unsupported_values[tool-choice], which still expects tool_choice='required' to raise a 400/422 error. This allowlist now forwards that request to the successful fake upstream, so the expected exception is not raised and the required CI job fails deterministically; move this case to an accepted-value test and update the compatibility matrix accordingly.
Useful? React with 👍 / 👎.
LobeHub tool-backed generation sends
tool_choice=required, which the gateway currently rejects before contacting upstream. Accept and preserveauto,noneandrequiredthrough the existing Codex serializers, retaining validation for unknown choices.Validation:
cargo test --workspace --lockedpassed, including standard/Lite conversion and public HTTP forwarding regressions.required(one function call) andnone(zero calls), both completing successfully.No credential or authentication changes.