fix(openai): centralize responses threshold parsing · openclaw/openclaw@ebb1615
steipete
·
2026-05-29
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -88,6 +88,31 @@ describe("openai responses payload policy", () => {
|
88 | 88 | }); |
89 | 89 | }); |
90 | 90 | |
| 91 | +it("accepts plus-signed responses compaction thresholds", () => { |
| 92 | +const payload = {} satisfies Record<string, unknown>; |
| 93 | + |
| 94 | +applyOpenAIResponsesPayloadPolicy( |
| 95 | +payload, |
| 96 | +resolveOpenAIResponsesPayloadPolicy( |
| 97 | +{ |
| 98 | +api: "openai-responses", |
| 99 | +provider: "openai", |
| 100 | +baseUrl: "https://api.openai.com/v1", |
| 101 | +}, |
| 102 | +{ |
| 103 | +enableServerCompaction: true, |
| 104 | +extraParams: { responsesCompactThreshold: "+120000" }, |
| 105 | +storeMode: "provider-policy", |
| 106 | +}, |
| 107 | +), |
| 108 | +); |
| 109 | + |
| 110 | +expect(payload).toEqual({ |
| 111 | +store: true, |
| 112 | +context_management: [{ type: "compaction", compact_threshold: 120_000 }], |
| 113 | +}); |
| 114 | +}); |
| 115 | + |
91 | 116 | it("strips store and prompt cache for proxy-like responses routes when requested", () => { |
92 | 117 | const policy = resolveOpenAIResponsesPayloadPolicy( |
93 | 118 | { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。