feat: upgrade investigation and presentation runtime
Generic Container CI/CD / test-build-publish (push) Successful in 1m6s
Agent CI/CD / build-test-publish-and-deploy (push) Successful in 1m7s

This commit is contained in:
2026-10-30 17:30:19 +08:00
parent 3b52a0ddab
commit 6336157ff4
104 changed files with 6541 additions and 961 deletions
+22
View File
@@ -547,6 +547,28 @@ describe("streamPromptResponse", () => {
});
});
it("streams native tool identity and sanitized full inputs with progress", async () => {
const address = "完整地址".repeat(70);
const runtime = {
subscribeEvents: async () => createEventStream([
{ type: "message.part.updated", properties: { sessionID: "runtime-session-1", part: {
id: "tool-part", sessionID: "runtime-session-1", messageID: "message-1", type: "tool",
callID: "native-call", tool: "mcp_tjwater_geocode", state: {
status: "completed", input: { address, api_key: "private-value" }, output: "done", time: { start: Date.now(), end: Date.now() }
}
} } },
{ type: "session.idle", properties: { sessionID: "runtime-session-1" } }
]),
prompt: async () => undefined,
messages: async () => []
} as unknown as OpencodeRuntimeAdapter;
const events: Array<{ event: string; data: Record<string, unknown> }> = [];
await streamPromptResponse({ runtime, sessionId: "runtime-session-1", clientSessionId: "client-session-1", message: "定位", write: (event, data) => events.push({ event, data }) });
const progress = events.find((item) => item.event === "progress" && item.data.id === "tool-part");
expect(progress?.data.tool).toEqual({ name: "mcp_tjwater_geocode", call_id: "native-call", input: { address, api_key: "[redacted]" } });
expect(progress?.data.detail).not.toContain("private-value");
});
it("converts question tool parts into question request SSE payloads", async () => {
const runtime = {
subscribeEvents: async () =>