This commit is contained in:
1EchA 2026-01-30 18:13:06 +05:30 committed by GitHub
commit 6caf2742db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,6 +9,7 @@ import { resolveThinkingDefault } from "../../agents/model-selection.js";
import { resolveAgentTimeoutMs } from "../../agents/timeout.js"; import { resolveAgentTimeoutMs } from "../../agents/timeout.js";
import { dispatchInboundMessage } from "../../auto-reply/dispatch.js"; import { dispatchInboundMessage } from "../../auto-reply/dispatch.js";
import { createReplyDispatcher } from "../../auto-reply/reply/reply-dispatcher.js"; import { createReplyDispatcher } from "../../auto-reply/reply/reply-dispatcher.js";
import { registerAgentRunContext } from "../../infra/agent-events.js";
import { import {
extractShortModelName, extractShortModelName,
type ResponsePrefixContext, type ResponsePrefixContext,
@ -369,6 +370,7 @@ export const chatHandlers: GatewayRequestHandlers = {
}); });
const now = Date.now(); const now = Date.now();
const clientRunId = p.idempotencyKey; const clientRunId = p.idempotencyKey;
registerAgentRunContext(clientRunId, { sessionKey: p.sessionKey });
const sendPolicy = resolveSendPolicy({ const sendPolicy = resolveSendPolicy({
cfg, cfg,
@ -430,6 +432,10 @@ export const chatHandlers: GatewayRequestHandlers = {
startedAtMs: now, startedAtMs: now,
expiresAtMs: resolveChatRunExpiresAtMs({ now, timeoutMs }), expiresAtMs: resolveChatRunExpiresAtMs({ now, timeoutMs }),
}); });
context.addChatRun(clientRunId, {
sessionKey: p.sessionKey,
clientRunId,
});
const ackPayload = { const ackPayload = {
runId: clientRunId, runId: clientRunId,