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

推荐订阅源

雷峰网
雷峰网
GbyAI
GbyAI
Stack Overflow Blog
Stack Overflow Blog
Apple Machine Learning Research
Apple Machine Learning Research
The Cloudflare Blog
WordPress大学
WordPress大学
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 聂微东
L
LangChain Blog
云风的 BLOG
云风的 BLOG
Jina AI
Jina AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
I
InfoQ
大猫的无限游戏
大猫的无限游戏
MyScale Blog
MyScale Blog
人人都是产品经理
人人都是产品经理
小众软件
小众软件
量子位
The GitHub Blog
The GitHub 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
test: tighten mantle anthropic assertions · openclaw/open...
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -30,6 +30,13 @@ function createTestDeps() {

3030

};

3131

}

323233+

function requireRecord(value: unknown, label: string): Record<string, unknown> {

34+

if (!value || typeof value !== "object" || Array.isArray(value)) {

35+

throw new Error(`Expected ${label} to be an object`);

36+

}

37+

return value as Record<string, unknown>;

38+

}

39+3340

describe("createMantleAnthropicStreamFn", () => {

3441

it("uses authToken bearer auth for Mantle Anthropic requests", () => {

3542

const stream = { kind: "anthropic-stream" };

@@ -46,31 +53,24 @@ describe("createMantleAnthropicStreamFn", () => {

4653

});

47544855

expect(result).toBe(stream);

49-

expect(deps.createClient).toHaveBeenCalledWith(

50-

expect.objectContaining({

51-

apiKey: null,

52-

authToken: "bedrock-bearer-token",

53-

baseURL: "https://bedrock-mantle.us-east-1.api.aws/anthropic",

54-

defaultHeaders: expect.objectContaining({

55-

accept: "application/json",

56-

"anthropic-beta": "fine-grained-tool-streaming-2025-05-14",

57-

"X-Test": "model-header",

58-

"X-Caller": "caller-header",

59-

}),

60-

}),

61-

);

62-

expect(deps.stream).toHaveBeenCalledWith(

63-

model,

64-

context,

65-

expect.objectContaining({

66-

client: expect.objectContaining({

67-

options: expect.objectContaining({

68-

authToken: "bedrock-bearer-token",

69-

}),

70-

}),

71-

thinkingEnabled: false,

72-

}),

56+

const clientOptions = requireRecord(deps.createClient.mock.calls[0]?.[0], "client options");

57+

expect(clientOptions.apiKey).toBeNull();

58+

expect(clientOptions.authToken).toBe("bedrock-bearer-token");

59+

expect(clientOptions.baseURL).toBe("https://bedrock-mantle.us-east-1.api.aws/anthropic");

60+

const defaultHeaders = requireRecord(clientOptions.defaultHeaders, "default headers");

61+

expect(defaultHeaders.accept).toBe("application/json");

62+

expect(defaultHeaders["anthropic-beta"]).toBe("fine-grained-tool-streaming-2025-05-14");

63+

expect(defaultHeaders["X-Test"]).toBe("model-header");

64+

expect(defaultHeaders["X-Caller"]).toBe("caller-header");

65+66+

expect(deps.stream.mock.calls[0]?.[0]).toBe(model);

67+

expect(deps.stream.mock.calls[0]?.[1]).toBe(context);

68+

const streamOptions = requireRecord(deps.stream.mock.calls[0]?.[2], "stream options");

69+

const client = requireRecord(streamOptions.client, "stream client");

70+

expect(requireRecord(client.options, "stream client options").authToken).toBe(

71+

"bedrock-bearer-token",

7372

);

73+

expect(streamOptions.thinkingEnabled).toBe(false);

7474

});

75757676

it("omits unsupported Opus 4.7 sampling and reasoning overrides", () => {

@@ -85,14 +85,11 @@ describe("createMantleAnthropicStreamFn", () => {

8585

reasoning: "high",

8686

});

878788-

expect(deps.stream).toHaveBeenCalledWith(

89-

model,

90-

context,

91-

expect.objectContaining({

92-

temperature: undefined,

93-

thinkingEnabled: false,

94-

}),

95-

);

88+

expect(deps.stream.mock.calls[0]?.[0]).toBe(model);

89+

expect(deps.stream.mock.calls[0]?.[1]).toBe(context);

90+

const streamOptions = requireRecord(deps.stream.mock.calls[0]?.[2], "stream options");

91+

expect(streamOptions.temperature).toBeUndefined();

92+

expect(streamOptions.thinkingEnabled).toBe(false);

9693

});

97949895

it("normalizes Mantle provider URLs to the Anthropic endpoint", () => {