Commit e8d005a
committed
fix(sdk): preserve x-trigger-branch on override POSTs and handle Request input in SSE wrapper
When chat.createStartSessionAction was given a baseURL or fetch
override, the inline POSTs for /api/v1/sessions and
/api/v1/auth/jwt/claims forgot to forward apiClientManager.branchName as
the x-trigger-branch header. Callers running against a preview branch
(via TRIGGER_PREVIEW_BRANCH or VERCEL_GIT_COMMIT_REF) would route to
the wrong environment in override mode. Extracted the header builder
to a shared helper.
The SSE fetch wrappers in TriggerChatTransport.subscribeToSessionStream
and AgentChat.subscribeToSessionStream cast to typeof fetch but coerced
non-string input via .toString(), which yields "[object Request]" on
Request objects and discards the Request's intrinsic method/headers/
signal. Replaced the coercion with explicit branches for string, URL,
and Request — Request inputs now extract url + init properly with any
caller-provided init taking precedence (matches fetch(Request, init)
semantics).1 parent f21c318 commit e8d005a
3 files changed
Lines changed: 61 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8648 | 8648 | | |
8649 | 8649 | | |
8650 | 8650 | | |
| 8651 | + | |
| 8652 | + | |
| 8653 | + | |
| 8654 | + | |
| 8655 | + | |
| 8656 | + | |
| 8657 | + | |
| 8658 | + | |
| 8659 | + | |
| 8660 | + | |
| 8661 | + | |
| 8662 | + | |
| 8663 | + | |
| 8664 | + | |
| 8665 | + | |
| 8666 | + | |
8651 | 8667 | | |
8652 | 8668 | | |
8653 | 8669 | | |
| |||
8664 | 8680 | | |
8665 | 8681 | | |
8666 | 8682 | | |
8667 | | - | |
8668 | | - | |
8669 | | - | |
8670 | | - | |
8671 | | - | |
| 8683 | + | |
8672 | 8684 | | |
8673 | 8685 | | |
8674 | 8686 | | |
| |||
8698 | 8710 | | |
8699 | 8711 | | |
8700 | 8712 | | |
8701 | | - | |
8702 | | - | |
8703 | | - | |
8704 | | - | |
8705 | | - | |
| 8713 | + | |
8706 | 8714 | | |
8707 | 8715 | | |
8708 | 8716 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
683 | 683 | | |
684 | 684 | | |
685 | 685 | | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
691 | 705 | | |
692 | | - | |
| 706 | + | |
| 707 | + | |
693 | 708 | | |
694 | 709 | | |
695 | 710 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1191 | 1191 | | |
1192 | 1192 | | |
1193 | 1193 | | |
1194 | | - | |
1195 | | - | |
1196 | | - | |
1197 | | - | |
1198 | | - | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
1199 | 1214 | | |
1200 | | - | |
| 1215 | + | |
| 1216 | + | |
1201 | 1217 | | |
1202 | 1218 | | |
1203 | 1219 | | |
| |||
0 commit comments