Commit 90d1ef4
fix(responses): strip mismatched agent_message item ids before passthrough (#215)
Routed threads can replay agent_message items whose ids lost their
amsg_ prefix (dialect-mixed histories). The ChatGPT Responses backend
validates the id prefix per item type and 400s the whole request --
Invalid 'input[N].id': 'msg_...'. Expected an ID that begins with 'amsg'.
-- which bricks the thread on every retry.
stripInvalidItemIds already covers message/reasoning/function_call/
custom_tool_call/tool_search_call/web_search_call; add the missing
agent_message -> amsg_ mapping so mismatched ids are stripped like
every other item type.
Co-authored-by: Robin Choi <robin@Robinui-MacBookPro.local>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent 304a1ea commit 90d1ef4
2 files changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
0 commit comments