Repository navigation
Conversation
Chat Completions treats an omitted strict flag as false. Responses may normalize the same function schema and require its optional arguments. Emit false for converted Chat functions with an omitted flag and forward explicit flags unchanged.
|
No actionable comments were generated in the recent review. WalkthroughOpenAI Responses encoding now sets ChangesFunction tool strictness
Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix Suggested reviewers: Merge Risk:
|
Agent: Codex unknown · unknown · macOS arm64 · 2026-11-28 UTC
Related: none
Request summary
Check whether new-api already preserves the Chat Completions default for function tools and submit the fix upstream. This patch was AI-assisted with Codex.
Summary
Chat Completions defaults to non-strict function calls. Responses can require optional parameters when the flag is absent. Preserve the Chat default during conversion.
Explicit
trueandfalsevalues keep their original values.Evidence
Local checkout of v1.0.0-rc.52 (
04dfcbb). An Advanced Custom adaptor sentgpt-testrequests to an HTTP Responses fixture with pass-through disabled. The fixture simulates strict normalization. The reproduction uses no database.lookupfunction requiresqueryand makesnoteoptional. DirectPOST /v1/responseswithstrict:falsereturned HTTP 200 and arguments{"query":"cube"}. For the equivalent Chat request, the fixture loggedstrict=omittedand returned HTTP 200 with{"query":"cube","note":""}.strict:falseand matched the direct HTTP 200 arguments. Inrelaykit,GOWORK=off go test ./relayconvert -run '^TestChatToResponsesPreservesFunctionStrictness$' -count=1failed on the missing field before the patch and passed after it. The independentgo build ./...andgo test ./...also passed.Merge Danger
Door: two-way
Blast Radius: relay
Summary by CodeRabbit
strict: falsewhen strictness isn’t specified. Explicitstrict: trueandstrict: falsevalues are preserved. This makes the resulting function-tool settings consistent while retaining any strictness choice already provided.