惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
C
Check Point Blog
J
Java Code Geeks
腾讯CDC
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
Engineering at Meta
Engineering at Meta
罗磊的独立博客
Last Week in AI
Last Week in AI
B
Blog
IT之家
IT之家
S
SegmentFault 最新的问题
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI
博客园 - 聂微东
U
Unit 42
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
MyScale Blog
MyScale Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: forward completions prompt cache keys · openclaw/ope...
steipete · 2026-04-25 · via Recent Commits to openclaw:main

@@ -37,7 +37,7 @@ describe("openai transport stream", () => {

3737

cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },

3838

contextWindow: 128000,

3939

maxTokens: 4096,

40-

} satisfies Model<"openai-completions">,

40+

} as unknown as Model<"openai-completions">,

4141

{ systemPrompt: "", messages: [] } as never,

4242

);

4343

@@ -1374,7 +1374,7 @@ describe("openai transport stream", () => {

13741374

cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },

13751375

contextWindow: 200000,

13761376

maxTokens: 8192,

1377-

} satisfies Model<"openai-completions">,

1377+

} as unknown as Model<"openai-completions">,

13781378

{

13791379

systemPrompt: "system",

13801380

messages: [],

@@ -1560,7 +1560,7 @@ describe("openai transport stream", () => {

15601560

cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },

15611561

contextWindow: 32768,

15621562

maxTokens: 8192,

1563-

} satisfies Model<"openai-completions">,

1563+

} as unknown as Model<"openai-completions">,

15641564

{

15651565

systemPrompt: "system",

15661566

messages: [],

@@ -1601,6 +1601,67 @@ describe("openai transport stream", () => {

16011601

expect(params.stream_options).toEqual({ include_usage: true });

16021602

});

160316031604+

it("forwards prompt_cache_key for opted-in OpenAI-compatible completions providers", () => {

1605+

const params = buildOpenAICompletionsParams(

1606+

{

1607+

id: "custom-model",

1608+

name: "Custom Model",

1609+

api: "openai-completions",

1610+

provider: "custom-cpa",

1611+

baseUrl: "https://proxy.example.com/v1",

1612+

compat: { supportsPromptCacheKey: true },

1613+

reasoning: false,

1614+

input: ["text"],

1615+

cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },

1616+

contextWindow: 32768,

1617+

maxTokens: 8192,

1618+

} as unknown as Model<"openai-completions">,

1619+

{

1620+

systemPrompt: "system",

1621+

messages: [],

1622+

tools: [],

1623+

} as never,

1624+

{ sessionId: "session-123" },

1625+

) as { prompt_cache_key?: string };

1626+1627+

expect(params.prompt_cache_key).toBe("session-123");

1628+

});

1629+1630+

it("omits prompt_cache_key for completions when caching is disabled or not opted in", () => {

1631+

const baseModel = {

1632+

id: "custom-model",

1633+

name: "Custom Model",

1634+

api: "openai-completions",

1635+

provider: "custom-cpa",

1636+

baseUrl: "https://proxy.example.com/v1",

1637+

reasoning: false,

1638+

input: ["text"],

1639+

cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },

1640+

contextWindow: 32768,

1641+

maxTokens: 8192,

1642+

} satisfies Model<"openai-completions">;

1643+

const context = {

1644+

systemPrompt: "system",

1645+

messages: [],

1646+

tools: [],

1647+

} as never;

1648+1649+

const disabled = buildOpenAICompletionsParams(

1650+

{

1651+

...baseModel,

1652+

compat: { supportsPromptCacheKey: true },

1653+

} as unknown as Model<"openai-completions">,

1654+

context,

1655+

{ sessionId: "session-123", cacheRetention: "none" },

1656+

) as { prompt_cache_key?: string };

1657+

const notOptedIn = buildOpenAICompletionsParams(baseModel, context, {

1658+

sessionId: "session-123",

1659+

}) as { prompt_cache_key?: string };

1660+1661+

expect(disabled.prompt_cache_key).toBeUndefined();

1662+

expect(notOptedIn.prompt_cache_key).toBeUndefined();

1663+

});

1664+16041665

it("disables developer-role-only compat defaults for configured custom proxy completions providers", () => {

16051666

const params = buildOpenAICompletionsParams(

16061667

{