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

推荐订阅源

博客园 - Franky
有赞技术团队
有赞技术团队
宝玉的分享
宝玉的分享
雷峰网
雷峰网
Hugging Face - Blog
Hugging Face - Blog
V
V2EX
大猫的无限游戏
大猫的无限游戏
博客园 - 司徒正美
D
Docker
T
The Blog of Author Tim Ferriss
罗磊的独立博客
博客园 - 叶小钗
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
J
Java Code Geeks
Jina AI
Jina AI
博客园 - 【当耐特】
C
Check Point Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
腾讯CDC
Last Week in AI
Last Week in AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Visual Studio 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: speed up chat UI tests · openclaw/openclaw@75a8f58
steipete · 2026-04-26 · via Recent Commits to openclaw:main

@@ -43,6 +43,83 @@ vi.mock("../icons.ts", () => ({

4343

icons: {},

4444

}));

454546+

vi.mock("../chat/build-chat-items.ts", () => ({

47+

buildChatItems: (props: {

48+

messages: unknown[];

49+

stream: string | null;

50+

streamStartedAt: number | null;

51+

}) => {

52+

if (props.messages.length > 0) {

53+

return [

54+

{

55+

kind: "group",

56+

key: "group:assistant:test",

57+

role: "assistant",

58+

messages: props.messages.map((message, index) => ({

59+

key: `message:${index}`,

60+

message,

61+

})),

62+

timestamp: 1,

63+

isStreaming: false,

64+

},

65+

];

66+

}

67+

if (props.stream !== null) {

68+

return props.stream

69+

? [

70+

{

71+

kind: "stream",

72+

key: "stream:test",

73+

text: props.stream,

74+

startedAt: props.streamStartedAt ?? 1,

75+

},

76+

]

77+

: [{ kind: "reading-indicator", key: "reading:test" }];

78+

}

79+

return [];

80+

},

81+

}));

82+83+

vi.mock("../chat/grouped-render.ts", () => ({

84+

renderMessageGroup: (group: { messages: Array<{ message: unknown }> }) => {

85+

const element = document.createElement("div");

86+

element.className = "chat-group";

87+

element.textContent = group.messages

88+

.map(({ message }) => {

89+

if (typeof message === "object" && message !== null && "content" in message) {

90+

const content = (message as { content?: unknown }).content;

91+

if (typeof content === "string") {

92+

return content;

93+

}

94+

return content == null ? "" : JSON.stringify(content);

95+

}

96+

return String(message);

97+

})

98+

.join("\n");

99+

return element;

100+

},

101+

renderReadingIndicatorGroup: () => {

102+

const element = document.createElement("div");

103+

element.className = "chat-reading-indicator";

104+

return element;

105+

},

106+

renderStreamingGroup: (text: string) => {

107+

const element = document.createElement("div");

108+

element.className = "chat-stream";

109+

element.textContent = text;

110+

return element;

111+

},

112+

}));

113+114+

vi.mock("../markdown.ts", () => ({

115+

toSanitizedMarkdownHtml: (value: string) => value,

116+

}));

117+118+

vi.mock("../chat/tool-expansion-state.ts", () => ({

119+

getExpandedToolCards: () => new Map<string, boolean>(),

120+

syncToolCardExpansionState: () => undefined,

121+

}));

122+46123

vi.mock("../controllers/agents.ts", () => ({

47124

refreshVisibleToolsEffectiveForCurrentSession: refreshVisibleToolsEffectiveForCurrentSessionMock,

48125

}));

@@ -454,8 +531,16 @@ describe("chat welcome", () => {

454531

});

455532456533

describe("chat session controls", () => {

457-

it("patches the current session model from the chat header picker", async () => {

534+

it("patches the current session model and refreshes active tool visibility", async () => {

458535

const { state, request } = createChatHeaderState();

536+

state.agentsPanel = "tools";

537+

state.agentsSelectedId = "main";

538+

state.toolsEffectiveResultKey = "main:main";

539+

state.toolsEffectiveResult = {

540+

agentId: "main",

541+

profile: "coding",

542+

groups: [],

543+

};

459544

const container = document.createElement("div");

460545

render(renderChatSessionSelect(state), container);

461546

@@ -477,29 +562,6 @@ describe("chat session controls", () => {

477562

expect(loadSessionsMock).toHaveBeenCalledTimes(1);

478563

expect(state.sessionsResult?.sessions[0]?.model).toBe("gpt-5-mini");

479564

expect(state.sessionsResult?.sessions[0]?.modelProvider).toBe("openai");

480-

});

481-482-

it("reloads effective tools after a chat-header model switch for the active tools panel", async () => {

483-

const { state, request } = createChatHeaderState();

484-

state.agentsPanel = "tools";

485-

state.agentsSelectedId = "main";

486-

state.toolsEffectiveResultKey = "main:main";

487-

state.toolsEffectiveResult = {

488-

agentId: "main",

489-

profile: "coding",

490-

groups: [],

491-

};

492-

const container = document.createElement("div");

493-

render(renderChatSessionSelect(state), container);

494-495-

const modelSelect = container.querySelector<HTMLSelectElement>(

496-

'select[data-chat-model-select="true"]',

497-

);

498-

expect(modelSelect).not.toBeNull();

499-500-

modelSelect!.value = "openai/gpt-5-mini";

501-

modelSelect!.dispatchEvent(new Event("change", { bubbles: true }));

502-

await flushTasks();

503565

expect(request).toHaveBeenCalledWith("tools.effective", {

504566

agentId: "main",

505567

sessionKey: "main",