Commit 247bb33
committed
fix(openai-base): align Responses API tool-call event IDs with main
Main's ai-openai emits TOOL_CALL_START/ARGS/END with the internal
function_call item id (item.id) as toolCallId, and includes both
toolCallName and toolName fields. The PR's openai-base extraction
tried to use the Responses API call_id instead and dropped
toolCallName, which broke the agent loop + tool-call E2E suite for
openai, grok, and openrouter.
- Use item.id uniformly for toolCallId (agent loop carries it back
as toolCallId on the tool ModelMessage, which the Responses API
accepts as call_id for function_call_output).
- Emit both toolCallName and toolName on TOOL_CALL_START/END events.
- Do the same for the Chat Completions adapter.
- Update the openai-base test that pinned the old call_id design.1 parent 04a9a1c commit 247bb33
3 files changed
Lines changed: 25 additions & 29 deletions
File tree
- packages/typescript/openai-base
- src/adapters
- tests
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
| 337 | + | |
337 | 338 | | |
338 | 339 | | |
339 | 340 | | |
| |||
376 | 377 | | |
377 | 378 | | |
378 | 379 | | |
| 380 | + | |
379 | 381 | | |
380 | 382 | | |
381 | 383 | | |
| |||
Lines changed: 15 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
| 284 | + | |
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| |||
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
577 | 571 | | |
578 | 572 | | |
579 | | - | |
580 | 573 | | |
581 | 574 | | |
582 | 575 | | |
583 | 576 | | |
584 | 577 | | |
585 | 578 | | |
586 | | - | |
| 579 | + | |
| 580 | + | |
587 | 581 | | |
588 | 582 | | |
589 | 583 | | |
590 | 584 | | |
591 | 585 | | |
592 | | - | |
| 586 | + | |
593 | 587 | | |
594 | 588 | | |
595 | 589 | | |
| |||
601 | 595 | | |
602 | 596 | | |
603 | 597 | | |
604 | | - | |
| 598 | + | |
605 | 599 | | |
606 | 600 | | |
607 | 601 | | |
| |||
615 | 609 | | |
616 | 610 | | |
617 | 611 | | |
618 | | - | |
619 | 612 | | |
620 | 613 | | |
621 | 614 | | |
622 | 615 | | |
623 | | - | |
| 616 | + | |
| 617 | + | |
624 | 618 | | |
625 | 619 | | |
626 | 620 | | |
627 | 621 | | |
628 | 622 | | |
629 | 623 | | |
630 | | - | |
| 624 | + | |
| 625 | + | |
631 | 626 | | |
632 | 627 | | |
633 | 628 | | |
| |||
Lines changed: 8 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
785 | 785 | | |
786 | 786 | | |
787 | 787 | | |
788 | | - | |
| 788 | + | |
789 | 789 | | |
790 | 790 | | |
791 | 791 | | |
| |||
854 | 854 | | |
855 | 855 | | |
856 | 856 | | |
857 | | - | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
858 | 861 | | |
859 | 862 | | |
860 | 863 | | |
861 | | - | |
862 | | - | |
| 864 | + | |
863 | 865 | | |
864 | 866 | | |
865 | | - | |
866 | 867 | | |
867 | 868 | | |
868 | 869 | | |
869 | | - | |
| 870 | + | |
870 | 871 | | |
871 | 872 | | |
872 | | - | |
873 | 873 | | |
874 | 874 | | |
875 | 875 | | |
876 | | - | |
877 | | - | |
| 876 | + | |
878 | 877 | | |
879 | 878 | | |
880 | 879 | | |
| |||
0 commit comments