fix(gateway): use canonical session key in chat.send
Fixes session key mismatch where chat.send used raw key (e.g. "main") but chat.history used canonical key (e.g. "agent:main:main"), causing messages to be written to one session but read from another. Fixes #2493
This commit is contained in:
parent
6044bf3637
commit
dd2aac40fa
@ -362,7 +362,7 @@ export const chatHandlers: GatewayRequestHandlers = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const { cfg, entry } = loadSessionEntry(p.sessionKey);
|
const { cfg, entry, canonicalKey } = loadSessionEntry(p.sessionKey);
|
||||||
const timeoutMs = resolveAgentTimeoutMs({
|
const timeoutMs = resolveAgentTimeoutMs({
|
||||||
cfg,
|
cfg,
|
||||||
overrideMs: p.timeoutMs,
|
overrideMs: p.timeoutMs,
|
||||||
@ -449,7 +449,7 @@ export const chatHandlers: GatewayRequestHandlers = {
|
|||||||
BodyForCommands: commandBody,
|
BodyForCommands: commandBody,
|
||||||
RawBody: parsedMessage,
|
RawBody: parsedMessage,
|
||||||
CommandBody: commandBody,
|
CommandBody: commandBody,
|
||||||
SessionKey: p.sessionKey,
|
SessionKey: canonicalKey,
|
||||||
Provider: INTERNAL_MESSAGE_CHANNEL,
|
Provider: INTERNAL_MESSAGE_CHANNEL,
|
||||||
Surface: INTERNAL_MESSAGE_CHANNEL,
|
Surface: INTERNAL_MESSAGE_CHANNEL,
|
||||||
OriginatingChannel: INTERNAL_MESSAGE_CHANNEL,
|
OriginatingChannel: INTERNAL_MESSAGE_CHANNEL,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user