fix(openai): keep volcengine streaming usage opt-in · openclaw/openclaw@b376780
steipete
·
2026-05-16
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -47,6 +47,21 @@ describe("volcengine plugin", () => {
|
47 | 47 | }); |
48 | 48 | }); |
49 | 49 | |
| 50 | +it("declares OpenAI-compatible streaming usage support in the manifest", () => { |
| 51 | +const pluginJson = JSON.parse( |
| 52 | +readFileSync(resolve(import.meta.dirname, "openclaw.plugin.json"), "utf-8"), |
| 53 | +); |
| 54 | + |
| 55 | +expect(pluginJson.providerRequest?.providers).toMatchObject({ |
| 56 | +volcengine: { |
| 57 | +openAICompletions: { supportsStreamingUsage: true }, |
| 58 | +}, |
| 59 | +"volcengine-plan": { |
| 60 | +openAICompletions: { supportsStreamingUsage: true }, |
| 61 | +}, |
| 62 | +}); |
| 63 | +}); |
| 64 | + |
50 | 65 | it("marks direct and coding models with tool schema keyword compat", async () => { |
51 | 66 | const provider = await registerSingleProviderPlugin(plugin); |
52 | 67 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -18,6 +18,20 @@
|
18 | 18 | "providerAuthAliases": { |
19 | 19 | "volcengine-plan": "volcengine" |
20 | 20 | }, |
| 21 | +"providerRequest": { |
| 22 | +"providers": { |
| 23 | +"volcengine": { |
| 24 | +"openAICompletions": { |
| 25 | +"supportsStreamingUsage": true |
| 26 | + } |
| 27 | + }, |
| 28 | +"volcengine-plan": { |
| 29 | +"openAICompletions": { |
| 30 | +"supportsStreamingUsage": true |
| 31 | + } |
| 32 | + } |
| 33 | + } |
| 34 | + }, |
21 | 35 | "modelCatalog": { |
22 | 36 | "providers": { |
23 | 37 | "volcengine": { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3151,7 +3151,7 @@ describe("openai transport stream", () => {
|
3151 | 3151 | expect(params.stream_options?.include_usage).toBe(true); |
3152 | 3152 | }); |
3153 | 3153 | |
3154 | | -it("omits streaming usage options for Volcengine CodingPlan by default", () => { |
| 3154 | +it("includes stream_options.include_usage for Volcengine CodingPlan", () => { |
3155 | 3155 | const params = buildOpenAICompletionsParams( |
3156 | 3156 | { |
3157 | 3157 | id: "ark-code-latest", |
@@ -3172,10 +3172,10 @@ describe("openai transport stream", () => {
|
3172 | 3172 | } as never, |
3173 | 3173 | undefined, |
3174 | 3174 | ) as { |
3175 | | -stream_options?: unknown; |
| 3175 | +stream_options?: { include_usage?: boolean }; |
3176 | 3176 | }; |
3177 | 3177 | |
3178 | | -expect(params).not.toHaveProperty("stream_options"); |
| 3178 | +expect(params.stream_options).toEqual({ include_usage: true }); |
3179 | 3179 | }); |
3180 | 3180 | |
3181 | 3181 | it("includes stream_options.include_usage for known local backends like llama-cpp", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。