fix(openai): default direct responses to sse · openclaw/openclaw@a4f2bf2
vincentkoc
·
2026-05-05
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -52,6 +52,7 @@ Docs: https://docs.openclaw.ai
|
52 | 52 | |
53 | 53 | ### Fixes |
54 | 54 | |
| 55 | +- Agents/OpenAI: default direct OpenAI Responses models to the SSE transport instead of WebSocket auto-selection, preventing pi runtime chat turns from hanging on servers where the WebSocket path stalls while the OpenAI HTTP stream works. Thanks @vincentkoc. |
55 | 56 | - CLI/update: disable and skip plugins that fail package-update plugin sync, so a broken npm/ClawHub/git/marketplace plugin cannot turn a successful OpenClaw package update into a failed update result. Thanks @vincentkoc. |
56 | 57 | - CLI/update: use an absolute POSIX npm script shell during package-manager updates, so restricted PATH environments can still run dependency lifecycle scripts while updating from `--tag main`. Fixes #77530. Thanks @PeterTremonti. |
57 | 58 | - Diagnostics: grant the internal diagnostics event bus to official installed diagnostics exporter plugins, so npm-installed `@openclaw/diagnostics-prometheus` can emit metrics without broadening the capability to arbitrary global plugins. Fixes #76628. Thanks @RayWoo. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -508,9 +508,9 @@ describe("buildOpenAIProvider", () => {
|
508 | 508 | }); |
509 | 509 | |
510 | 510 | expect(extraParams).toMatchObject({ |
511 | | -transport: "auto", |
512 | | -openaiWsWarmup: true, |
| 511 | +transport: "sse", |
513 | 512 | }); |
| 513 | +expect(extraParams?.openaiWsWarmup).toBeUndefined(); |
514 | 514 | expect(result.payload.store).toBe(true); |
515 | 515 | expect(result.payload.context_management).toEqual([ |
516 | 516 | { type: "compaction", compact_threshold: 140_000 }, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -227,7 +227,7 @@ export function buildOpenAIProvider(): ProviderPlugin {
|
227 | 227 | shouldUseOpenAIResponsesTransport({ provider, api, baseUrl }) |
228 | 228 | ? { api: "openai-responses", baseUrl } |
229 | 229 | : undefined, |
230 | | - ...buildOpenAIResponsesProviderHooks({ openaiWsWarmup: true }), |
| 230 | + ...buildOpenAIResponsesProviderHooks({ transport: "sse" }), |
231 | 231 | matchesContextOverflowError: ({ errorMessage }) => |
232 | 232 | /content_filter.*(?:prompt|input).*(?:too long|exceed)/i.test(errorMessage), |
233 | 233 | resolveReasoningOutputMode: () => "native", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -50,18 +50,19 @@ function hasSupportedOpenAIResponsesTransport(
|
50 | 50 | |
51 | 51 | function defaultOpenAIResponsesExtraParams( |
52 | 52 | extraParams: Record<string, unknown> | undefined, |
53 | | -options?: { openaiWsWarmup?: boolean }, |
| 53 | +options?: { openaiWsWarmup?: boolean; transport?: "auto" | "sse" | "websocket" }, |
54 | 54 | ): Record<string, unknown> | undefined { |
55 | 55 | const hasSupportedTransport = hasSupportedOpenAIResponsesTransport(extraParams?.transport); |
56 | 56 | const hasExplicitWarmup = typeof extraParams?.openaiWsWarmup === "boolean"; |
| 57 | +const defaultTransport = options?.transport ?? "auto"; |
57 | 58 | const shouldDefaultWarmup = options?.openaiWsWarmup === true; |
58 | 59 | if (hasSupportedTransport && (!shouldDefaultWarmup || hasExplicitWarmup)) { |
59 | 60 | return extraParams; |
60 | 61 | } |
61 | 62 | |
62 | 63 | return { |
63 | 64 | ...extraParams, |
64 | | - ...(hasSupportedTransport ? {} : { transport: "auto" }), |
| 65 | + ...(hasSupportedTransport ? {} : { transport: defaultTransport }), |
65 | 66 | ...(shouldDefaultWarmup && !hasExplicitWarmup ? { openaiWsWarmup: true } : {}), |
66 | 67 | }; |
67 | 68 | } |
@@ -93,6 +94,7 @@ const wrapOpenAIResponsesProviderStreamFn: NonNullable<
|
93 | 94 | |
94 | 95 | export function buildOpenAIResponsesProviderHooks(options?: { |
95 | 96 | openaiWsWarmup?: boolean; |
| 97 | +transport?: "auto" | "sse" | "websocket"; |
96 | 98 | }): OpenAIResponsesProviderHooks { |
97 | 99 | return { |
98 | 100 | buildReplayPolicy: buildOpenAIReplayPolicy, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。