test: tighten openrouter extra params assertions · openclaw/openclaw@10a6751
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -104,10 +104,9 @@ describe("applyExtraParamsToAgent OpenRouter reasoning", () => {
|
104 | 104 | {}, |
105 | 105 | ); |
106 | 106 | |
107 | | -expect(calls[0]?.headers).toMatchObject({ |
108 | | -"X-OpenRouter-Cache": "true", |
109 | | -"X-OpenRouter-Cache-TTL": "600", |
110 | | -}); |
| 107 | +const headers = calls[0]?.headers; |
| 108 | +expect(headers?.["X-OpenRouter-Cache"]).toBe("true"); |
| 109 | +expect(headers?.["X-OpenRouter-Cache-TTL"]).toBe("600"); |
111 | 110 | }); |
112 | 111 | |
113 | 112 | it("honors narrower camelCase response cache params over wider snake_case aliases", () => { |
@@ -154,11 +153,10 @@ describe("applyExtraParamsToAgent OpenRouter reasoning", () => {
|
154 | 153 | {}, |
155 | 154 | ); |
156 | 155 | |
157 | | -expect(calls[0]?.headers).toMatchObject({ |
158 | | -"X-OpenRouter-Cache": "true", |
159 | | -"X-OpenRouter-Cache-Clear": "true", |
160 | | -"X-OpenRouter-Cache-TTL": "600", |
161 | | -}); |
| 156 | +const headers = calls[0]?.headers; |
| 157 | +expect(headers?.["X-OpenRouter-Cache"]).toBe("true"); |
| 158 | +expect(headers?.["X-OpenRouter-Cache-Clear"]).toBe("true"); |
| 159 | +expect(headers?.["X-OpenRouter-Cache-TTL"]).toBe("600"); |
162 | 160 | }); |
163 | 161 | |
164 | 162 | it("injects reasoning.effort when thinkingLevel is non-off for OpenRouter", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。