fix(openai): infer previous response for item references

This commit is contained in:
shaw
2026-04-30 12:02:08 +08:00
parent 733627cf9d
commit 094e1171ef
4 changed files with 11 additions and 9 deletions

View File

@@ -1379,10 +1379,12 @@ func shouldInferIngressFunctionCallOutputPreviousResponseID(
if signals.HasFunctionCallOutputMissingCallID {
return false
}
// If the client already sent tool-call context or item_reference anchors,
// treat this as a full replay / self-contained continuation payload rather
// than downgrading it into an inferred delta continuation.
if signals.HasToolCallContext || signals.HasItemReferenceForAllCallIDs {
// If the client already sent the actual tool-call context, treat this as
// a full replay / self-contained continuation payload rather than
// downgrading it into an inferred delta continuation. item_reference alone
// is not enough on the store=false WS path: it still needs a valid prior
// response anchor so upstream can resolve the referenced function_call.
if signals.HasToolCallContext {
return false
}
return strings.TrimSpace(expectedPreviousResponseID) != ""