Skip to content

Commit c675b35

Browse files
committed
docs(openai): document responses replay id contract
1 parent c7cd53e commit c675b35

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/agents/pi-embedded-helpers/openai.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,11 @@ function createOpenAIResponsesToolCallIdResolver(): {
185185
}
186186

187187
/**
188-
* OpenAI Responses validates replayed `function_call.call_id`,
189-
* `function_call.id`, and matching `function_call_output.call_id` values.
190-
* Keep canonical ids unchanged, but deterministically rewrite overlong or
191-
* malformed persisted ids before pi-ai splits `call_id|fc_id` pairs.
188+
* OpenAI Responses rejects replayed `function_call.call_id`,
189+
* `function_call.id`, and matching `function_call_output.call_id` values
190+
* that exceed its 64-char `call_*` / `fc_*` shape. pi-ai skips its own
191+
* normalizer for same-model replay, then splits persisted `call_id|fc_id`
192+
* pairs directly into the provider payload, so OpenClaw must normalize here.
192193
*/
193194
export function normalizeOpenAIResponsesToolCallIds(messages: AgentMessage[]): AgentMessage[] {
194195
let changed = false;

0 commit comments

Comments
 (0)