summary
an openai chat request with function.strict: true loses that field when switchyard translates it to an anthropic messages target.
repro
send an openai chat request with a function tool that sets strict: true through an anthropic_messages target. the captured anthropic request contains the tool name, description, and input schema, but no strict field.
i also forwarded the captured request to the live anthropic messages api. it returned http 200, but the call was running without strict schema enforcement because the field had already been removed.
root cause
the openai decoder stores the value in ToolDefinition.strict, but encode_anthropic_tools does not write it into the outbound anthropic tool definition.
expected
preserve true and false, and leave the field out when it was not specified.
found while reviewing #585, which fixes the same loss in the opposite anthropic-to-openai direction.
summary
an openai chat request with
function.strict: trueloses that field when switchyard translates it to an anthropic messages target.repro
send an openai chat request with a function tool that sets
strict: truethrough ananthropic_messagestarget. the captured anthropic request contains the tool name, description, and input schema, but nostrictfield.i also forwarded the captured request to the live anthropic messages api. it returned http 200, but the call was running without strict schema enforcement because the field had already been removed.
root cause
the openai decoder stores the value in
ToolDefinition.strict, butencode_anthropic_toolsdoes not write it into the outbound anthropic tool definition.expected
preserve
trueandfalse, and leave the field out when it was not specified.found while reviewing #585, which fixes the same loss in the opposite anthropic-to-openai direction.