Commit 3ee7be3
committed
🤖 fix: preserve OpenAI reasoning providerMetadata for Responses API
When OpenAI's Responses API returns reasoning parts, they include
providerMetadata.openai.itemId which is required when sending
reasoning parts back to continue a conversation. Without this,
the AI SDK warns 'Non-OpenAI reasoning parts are not supported'
and skips the reasoning content.
Changes:
- Add providerMetadata field to MuxReasoningPart type
- Update ReasoningDeltaPart interface to capture providerMetadata from SDK
- Store providerMetadata when processing reasoning-delta events
- Add test verifying providerOptions preservation during coalescing
The AI SDK's convertToModelMessages() already maps providerMetadata
to providerOptions, so storing it on reasoning parts is sufficient.
---
_Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking: `high`_1 parent 85522bd commit 3ee7be3
File tree
3 files changed
+56
-1
lines changed- src
- browser/utils/messages
- common/types
- node/services
3 files changed
+56
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
637 | 637 | | |
638 | 638 | | |
639 | 639 | | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
640 | 683 | | |
641 | 684 | | |
642 | 685 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
148 | 151 | | |
149 | 152 | | |
150 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
| 50 | + | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| |||
848 | 851 | | |
849 | 852 | | |
850 | 853 | | |
851 | | - | |
| 854 | + | |
| 855 | + | |
852 | 856 | | |
853 | 857 | | |
| 858 | + | |
854 | 859 | | |
855 | 860 | | |
856 | 861 | | |
857 | 862 | | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
858 | 867 | | |
859 | 868 | | |
860 | 869 | | |
| |||
0 commit comments