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

推荐订阅源

人人都是产品经理
人人都是产品经理
Google DeepMind News
Google DeepMind News
博客园 - 【当耐特】
量子位
博客园 - 司徒正美
爱范儿
爱范儿
Hugging Face - Blog
Hugging Face - Blog
博客园 - 聂微东
Jina AI
Jina AI
J
Java Code Geeks
腾讯CDC
大猫的无限游戏
大猫的无限游戏
V
Visual Studio Blog
I
InfoQ
D
Docker
Recent Announcements
Recent Announcements
MongoDB | Blog
MongoDB | Blog
博客园 - Franky
宝玉的分享
宝玉的分享
G
Google Developers Blog
GbyAI
GbyAI
Y
Y Combinator Blog
有赞技术团队
有赞技术团队
H
Help Net Security

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(qa): make matrix block streaming deterministic · open...
vincentkoc · 2026-05-28 · via Recent Commits to openclaw:main

@@ -643,7 +643,7 @@ function execCommandFromToolProgressPrompt(prompt: string) {

643643

);

644644

}

645645646-

function buildToolCallEventsWithArgs(name: string, args: Record<string, unknown>): StreamEvent[] {

646+

function buildMockFunctionCall(name: string, args: Record<string, unknown>) {

647647

const serialized = JSON.stringify(args);

648648

const callSuffix = createHash("sha1")

649649

.update(name)

@@ -653,42 +653,46 @@ function buildToolCallEventsWithArgs(name: string, args: Record<string, unknown>

653653

.slice(0, 10);

654654

const callId = `call_mock_${name}_${callSuffix}`;

655655

const itemId = `fc_mock_${name}_${callSuffix}`;

656+

const item = {

657+

type: "function_call",

658+

id: itemId,

659+

call_id: callId,

660+

name,

661+

arguments: serialized,

662+

};

663+

return {

664+

callId,

665+

item,

666+

itemId,

667+

responseId: `resp_mock_${name}_${callSuffix}`,

668+

serialized,

669+

};

670+

}

671+672+

function buildToolCallEventsWithArgs(name: string, args: Record<string, unknown>): StreamEvent[] {

673+

const call = buildMockFunctionCall(name, args);

656674

return [

657675

{

658676

type: "response.output_item.added",

659677

item: {

660678

type: "function_call",

661-

id: itemId,

662-

call_id: callId,

679+

id: call.itemId,

680+

call_id: call.callId,

663681

name,

664682

arguments: "",

665683

},

666684

},

667-

{ type: "response.function_call_arguments.delta", delta: serialized },

685+

{ type: "response.function_call_arguments.delta", delta: call.serialized },

668686

{

669687

type: "response.output_item.done",

670-

item: {

671-

type: "function_call",

672-

id: itemId,

673-

call_id: callId,

674-

name,

675-

arguments: serialized,

676-

},

688+

item: call.item,

677689

},

678690

{

679691

type: "response.completed",

680692

response: {

681-

id: `resp_mock_${name}_${callSuffix}`,

693+

id: call.responseId,

682694

status: "completed",

683-

output: [

684-

{

685-

type: "function_call",

686-

id: itemId,

687-

call_id: callId,

688-

name,

689-

arguments: serialized,

690-

},

691-

],

695+

output: [call.item],

692696

usage: { input_tokens: 64, output_tokens: 16, total_tokens: 80 },

693697

},

694698

},

@@ -1449,6 +1453,78 @@ function buildAssistantOutputItem(spec: MockAssistantMessageSpec) {

14491453

} as const;

14501454

}

145114551456+

function appendAssistantMessageEvents(events: StreamEvent[], spec: MockAssistantMessageSpec) {

1457+

events.push({

1458+

type: "response.output_item.added",

1459+

item: {

1460+

type: "message",

1461+

id: spec.id,

1462+

role: "assistant",

1463+

...(spec.phase ? { phase: spec.phase } : {}),

1464+

content: [],

1465+

status: "in_progress",

1466+

},

1467+

});

1468+

for (const delta of spec.streamDeltas ?? []) {

1469+

events.push({

1470+

type: "response.output_text.delta",

1471+

item_id: spec.id,

1472+

output_index: 0,

1473+

content_index: 0,

1474+

delta,

1475+

});

1476+

}

1477+

if ((spec.streamDeltas ?? []).length > 0) {

1478+

events.push({

1479+

type: "response.output_text.done",

1480+

item_id: spec.id,

1481+

output_index: 0,

1482+

content_index: 0,

1483+

text: spec.text,

1484+

});

1485+

}

1486+

events.push({

1487+

type: "response.output_item.done",

1488+

item: buildAssistantOutputItem(spec),

1489+

});

1490+

}

1491+1492+

function buildAssistantThenToolCallEvents(

1493+

spec: MockAssistantMessageSpec,

1494+

name: string,

1495+

args: Record<string, unknown>,

1496+

): StreamEvent[] {

1497+

const call = buildMockFunctionCall(name, args);

1498+

const message = buildAssistantOutputItem(spec);

1499+

const events: StreamEvent[] = [];

1500+

appendAssistantMessageEvents(events, spec);

1501+

events.push({

1502+

type: "response.output_item.added",

1503+

item: {

1504+

type: "function_call",

1505+

id: call.itemId,

1506+

call_id: call.callId,

1507+

name,

1508+

arguments: "",

1509+

},

1510+

});

1511+

events.push({ type: "response.function_call_arguments.delta", delta: call.serialized });

1512+

events.push({

1513+

type: "response.output_item.done",

1514+

item: call.item,

1515+

});

1516+

events.push({

1517+

type: "response.completed",

1518+

response: {

1519+

id: call.responseId,

1520+

status: "completed",

1521+

output: [message, call.item],

1522+

usage: { input_tokens: 64, output_tokens: 32, total_tokens: 96 },

1523+

},

1524+

});

1525+

return events;

1526+

}

1527+14521528

function buildAssistantEvents(specsOrText: MockAssistantMessageSpec[] | string): StreamEvent[] {

14531529

const specs =

14541530

typeof specsOrText === "string"

@@ -1861,13 +1937,21 @@ async function buildResponsesPayload(

18611937

return buildAssistantEvents(toolProgressReplyDirective);

18621938

}

18631939

if (QA_BLOCK_STREAMING_PROMPT_RE.test(allInputText) && blockStreamingMarkers) {

1940+

if (!toolOutput) {

1941+

return buildAssistantThenToolCallEvents(

1942+

{

1943+

id: "msg_mock_block_1",

1944+

phase: "final_answer",

1945+

streamDeltas: splitMockStreamingText(blockStreamingMarkers.first),

1946+

text: blockStreamingMarkers.first,

1947+

},

1948+

"read",

1949+

{

1950+

path: readTargetFromPrompt(blockStreamingPrompt),

1951+

},

1952+

);

1953+

}

18641954

return buildAssistantEvents([

1865-

{

1866-

id: "msg_mock_block_1",

1867-

phase: "final_answer",

1868-

streamDeltas: splitMockStreamingText(blockStreamingMarkers.first),

1869-

text: blockStreamingMarkers.first,

1870-

},

18711955

{

18721956

id: "msg_mock_block_2",

18731957

phase: "final_answer",