fix: avoid sessions_send timeouts

This commit is contained in:
Peter Steinberger
2026-01-04 01:52:01 +01:00
parent cbf41859aa
commit fe67073b74
6 changed files with 10 additions and 0 deletions

View File

@@ -25,6 +25,7 @@
- CI: fix lint ordering after merge cleanup (#156) — thanks @steipete. - CI: fix lint ordering after merge cleanup (#156) — thanks @steipete.
- CI: consolidate checks to avoid redundant installs (#144) — thanks @thewilloftheshadow. - CI: consolidate checks to avoid redundant installs (#144) — thanks @thewilloftheshadow.
- WhatsApp: support `gifPlayback` for MP4 GIF sends via CLI/gateway. - WhatsApp: support `gifPlayback` for MP4 GIF sends via CLI/gateway.
- Sessions: prevent `sessions_send` timeouts by running nested agent turns on a separate lane.
- Auto-reply: drop final payloads when block streaming to avoid duplicate Discord sends. - Auto-reply: drop final payloads when block streaming to avoid duplicate Discord sends.
- Auto-reply: fix typing TTL to 2 minutes and log TTL with s/m units. - Auto-reply: fix typing TTL to 2 minutes and log TTL with s/m units.
- Bash tool: default auto-background delay to 10s. - Bash tool: default auto-background delay to 10s.

View File

@@ -183,6 +183,9 @@ describe("sessions tools", () => {
(call) => call.method === "chat.history", (call) => call.method === "chat.history",
); );
expect(agentCalls).toHaveLength(2); expect(agentCalls).toHaveLength(2);
for (const call of agentCalls) {
expect(call.params).toMatchObject({ lane: "nested" });
}
expect(waitCalls).toHaveLength(1); expect(waitCalls).toHaveLength(1);
expect(historyOnlyCalls).toHaveLength(1); expect(historyOnlyCalls).toHaveLength(1);
expect(waitCalls[0]?.params).toMatchObject({ afterMs: 1234 }); expect(waitCalls[0]?.params).toMatchObject({ afterMs: 1234 });

View File

@@ -2748,6 +2748,7 @@ function createSessionsSendTool(): AnyAgentTool {
sessionKey: resolvedKey, sessionKey: resolvedKey,
idempotencyKey, idempotencyKey,
deliver: false, deliver: false,
lane: "nested",
}; };
if (timeoutSeconds === 0) { if (timeoutSeconds === 0) {

View File

@@ -60,6 +60,7 @@ type AgentCommandOpts = {
provider?: string; // delivery provider (whatsapp|telegram|...) provider?: string; // delivery provider (whatsapp|telegram|...)
bestEffortDeliver?: boolean; bestEffortDeliver?: boolean;
abortSignal?: AbortSignal; abortSignal?: AbortSignal;
lane?: string;
}; };
type SessionResolution = { type SessionResolution = {
@@ -383,6 +384,7 @@ export async function agentCommand(
verboseLevel: resolvedVerboseLevel, verboseLevel: resolvedVerboseLevel,
timeoutMs, timeoutMs,
runId: sessionId, runId: sessionId,
lane: opts.lane,
abortSignal: opts.abortSignal, abortSignal: opts.abortSignal,
onAgentEvent: (evt) => { onAgentEvent: (evt) => {
emitAgentEvent({ emitAgentEvent({

View File

@@ -208,6 +208,7 @@ export const AgentParamsSchema = Type.Object(
deliver: Type.Optional(Type.Boolean()), deliver: Type.Optional(Type.Boolean()),
channel: Type.Optional(Type.String()), channel: Type.Optional(Type.String()),
timeout: Type.Optional(Type.Integer({ minimum: 0 })), timeout: Type.Optional(Type.Integer({ minimum: 0 })),
lane: Type.Optional(Type.String()),
idempotencyKey: NonEmptyString, idempotencyKey: NonEmptyString,
}, },
{ additionalProperties: false }, { additionalProperties: false },

View File

@@ -2930,6 +2930,7 @@ export async function handleGatewayRequest(
thinking?: string; thinking?: string;
deliver?: boolean; deliver?: boolean;
channel?: string; channel?: string;
lane?: string;
idempotencyKey: string; idempotencyKey: string;
timeout?: number; timeout?: number;
}; };
@@ -3118,6 +3119,7 @@ export async function handleGatewayRequest(
timeout: params.timeout?.toString(), timeout: params.timeout?.toString(),
bestEffortDeliver, bestEffortDeliver,
surface: "VoiceWake", surface: "VoiceWake",
lane: params.lane,
}, },
defaultRuntime, defaultRuntime,
deps, deps,