fix: 校正实时探针可选工具事件合同

This commit is contained in:
Codex
2026-07-11 20:56:01 +02:00
parent 127cd8c220
commit 98e4cde51f
6 changed files with 196 additions and 15 deletions
@@ -28,6 +28,14 @@ test("realtime fanout runner contract derives topics, groups, and independent ca
projectionOutboxRelay: false,
projectionRealtime: false,
});
assert.deepEqual(profiles["pure-kafka-live"]?.requiredEventTypes, {
agentrun: ["user_message", "assistant_message", "terminal_status"],
hwlab: ["user", "assistant", "terminal"],
});
assert.deepEqual(profiles["pure-kafka-live"]?.conditionalEventTypePairs, {
"tool-call": { agentrun: "tool_call", hwlab: "tool" },
"command-output": { agentrun: "command_output", hwlab: "status" },
});
});
test("Workbench Kafka debug replay runner contract is derived from owning YAML", () => {
@@ -41,8 +41,14 @@ test("validateRealtimeFanout parses the YAML profile and two independent prompts
refreshHandoff: true,
replayPriorTraceOnReconnect: true,
});
assert.ok(spec.webProbe?.realtimeFanoutProfiles?.["pure-kafka-live"]?.requiredEventTypes.agentrun.includes("user_message"));
assert.ok(spec.webProbe?.realtimeFanoutProfiles?.["pure-kafka-live"]?.requiredEventTypes.hwlab.includes("user"));
assert.deepEqual(spec.webProbe?.realtimeFanoutProfiles?.["pure-kafka-live"]?.requiredEventTypes, {
agentrun: ["user_message", "assistant_message", "terminal_status"],
hwlab: ["user", "assistant", "terminal"],
});
assert.deepEqual(spec.webProbe?.realtimeFanoutProfiles?.["pure-kafka-live"]?.conditionalEventTypePairs, {
"tool-call": { agentrun: "tool_call", hwlab: "tool" },
"command-output": { agentrun: "command_output", hwlab: "status" },
});
});
test("validateRealtimeFanout refuses body as a substitute for the second prompt", () => {