Skip to content

Commit a78c3ec

Browse files
committed
fix: keep provenance sourceChannel out of delivery routing
Only use sourceChannel for Provider/Surface (prompt metadata), not OriginatingChannel. OriginatingChannel is persisted as session delivery state and overriding it with provenance metadata could corrupt future reply routing.
1 parent a332186 commit a78c3ec

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎src/gateway/server-methods/chat.ts‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2257,9 +2257,13 @@ export const chatHandlers: GatewayRequestHandlers = {
22572257
CommandBody: commandBody,
22582258
InputProvenance: systemInputProvenance,
22592259
SessionKey: sessionKey,
2260-
Provider: (canInjectSystemProvenance(client) && systemInputProvenance?.sourceChannel) || INTERNAL_MESSAGE_CHANNEL,
2261-
Surface: (canInjectSystemProvenance(client) && systemInputProvenance?.sourceChannel) || INTERNAL_MESSAGE_CHANNEL,
2262-
OriginatingChannel: (canInjectSystemProvenance(client) && systemInputProvenance?.sourceChannel) || originatingChannel,
2260+
Provider:
2261+
(canInjectSystemProvenance(client) && systemInputProvenance?.sourceChannel) ||
2262+
INTERNAL_MESSAGE_CHANNEL,
2263+
Surface:
2264+
(canInjectSystemProvenance(client) && systemInputProvenance?.sourceChannel) ||
2265+
INTERNAL_MESSAGE_CHANNEL,
2266+
OriginatingChannel: originatingChannel,
22632267
OriginatingTo: originatingTo,
22642268
ExplicitDeliverRoute: explicitDeliverRoute,
22652269
AccountId: accountId,

0 commit comments

Comments
 (0)