Merge branch 'pr-10410' into HEAD

# Conflicts:
#	packages/durable/src/harness/types.ts
This commit is contained in:
Mario Zechner 2026-11-04 10:22:20 +00:00
commit a71fe1d532
2 changed files with 15 additions and 1 deletions

View file

@ -10,6 +10,7 @@ import type {
Model,
Models,
ModelThinkingLevel,
ThinkingBudgets,
Tool,
ToolCall,
ToolResultMessage,
@ -547,6 +548,10 @@ export type ConversationCreateOptions = {
export type ConversationStreamOptions = {
transport?: Transport;
timeoutMs?: number;
/** WebSocket connection/open handshake timeout; stream idleness uses `timeoutMs`. */
websocketConnectTimeoutMs?: number;
/** Custom token budgets for thinking levels on token-based providers. */
thinkingBudgets?: ThinkingBudgets;
/** Provider/SDK retries inside one request attempt. */
maxRetries?: number;
maxRetryDelayMs?: number;

View file

@ -384,7 +384,12 @@ describe("generation", () => {
return fauxAssistantMessage("b");
},
]);
setup.settings.stream = { timeoutMs: 1234, headers: { "x-test": "1" } };
setup.settings.stream = {
timeoutMs: 1234,
headers: { "x-test": "1" },
websocketConnectTimeoutMs: 5678,
thinkingBudgets: { minimal: 128, low: 512, medium: 2048, high: 8192 },
};
const { harness, root } = await openChat(new MemoryStorage(), setup);
await root.configure({ thinkingLevel: "high" }, context);
harness.resume();
@ -399,11 +404,15 @@ describe("generation", () => {
headers: { "x-test": "1" },
reasoning: "high",
sessionId,
websocketConnectTimeoutMs: 5678,
thinkingBudgets: { minimal: 128, low: 512, medium: 2048, high: 8192 },
});
expect(seen[0]!.signal).toBeInstanceOf(AbortSignal);
expect(seen[1]!.reasoning).toBeUndefined();
expect(seen[1]).toMatchObject({ timeoutMs: 99, sessionId });
expect(seen[1]!.headers).toBeUndefined();
expect(seen[1]!.websocketConnectTimeoutMs).toBeUndefined();
expect(seen[1]!.thinkingBudgets).toBeUndefined();
await harness.close(context);
});