OpenAI native: use nested function tools by default#169
OpenAI native: use nested function tools by default#169PrzemyslawKlys merged 1 commit intomasterfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ca38d15f4c
ℹ️ 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 (!IsToolSchemaUnknownParameter(ex)) { | ||
| throw; |
There was a problem hiding this comment.
Retry on unsupported tool-format validation errors
This loop now stops unless IsToolSchemaUnknownParameter(ex) is true, so a backend that rejects the new default function tool shape with a non-unknown_parameter validation error (for example invalid_value on tools[0].type) will throw immediately and never reach the later Custom* fallback candidates. Because this commit switched the initial attempt to FunctionNestedParameters, that behavior is a regression for custom-only ChatGPT-native variants that previously worked with the old custom-first default.
Useful? React with 👍 / 👎.
IntelligenceX ReviewReviewing PR #169: OpenAI native: use nested function tools by default Merge blockers: items in Todo List ✅ and Critical Issues Summary 📝This moves the default tool wire format to the standard Responses API shape ( Todo List ✅
Critical Issues
|
| if (!attempted.Add(retryFormat)) { | ||
| lastError!.Throw(); | ||
| } | ||
| var candidates = new[] { |
There was a problem hiding this comment.
Retry order is fixed and ignores the server-indicated failing field (parameters vs input_schema); use TryGetToolSchemaKeyFallback to choose the next candidate within the same family to avoid extra failing requests.
| throw; | ||
| } catch (Exception ex) { | ||
| lastError = ExceptionDispatchInfo.Capture(ex); | ||
| if (!IsToolSchemaUnknownParameter(ex)) { |
There was a problem hiding this comment.
IsToolSchemaUnknownParameter is currently broader than “unknown tool schema field” (it matches any “unknown field/parameter” + “tools” substring); consider gating retries on a parsed tools[<n>]... path to avoid retrying non-schema request bugs.
Fixes ChatGPT native responses rejecting tool schemas like ools[0].parameters by defaulting to standard Responses API tool format: ools[].type=function with ools[].function.{name,parameters}.
Also broadens tool wire-format fallbacks (nested -> flat -> custom) but only retries when the server indicates an unknown tool field under ools....
Tests: