fix(webui): update usage and tool progress during active turns (#6553)

* fix(webui): stream model status and usage during active turns

* fix(webui): keep live rounds and active-run status consistent

* fix(webui): reuse existing run indicators without extra status text

* fix(webui): preserve live activity and batch durable delivery

Cancel and drain sibling tools when progress notifications fail, retain balanced checkpoints, and keep model telemetry separate from answer provenance.

Group-commit already queued activity at the channel delivery boundary while preserving FIFO, generation ownership, per-envelope admission, and commit-before-fanout semantics. Isolate invalid members without dropping valid neighboring events.

Retain tool detail lazy grouping and cover scheduling, cancellation, persistence, encoding failures, and projection regressions.

* test(webui): separate standard-library imports in batch regression

* test: tighten live execution checks and clarify contracts

* refactor: remove redundant live execution comments

* refactor: settle tool results through one output path
This commit is contained in:
chengyongru authored and GitHub committed 2026-11-04 16:27:24 +08:00
1 parent 006a535537
commit 8ff04aad2b
52 files changed
+2065 -211

No files matched your search

+12 -3
View File
@@ -32,6 +32,7 @@ import {
fetchSkills,
fetchTrendingMarketplaceSkills,
fetchWebuiThread,
fetchSubagentThread,
fetchWebuiThreadTraceDetail,
fetchWorkspaces,
importMcpConfig,
@@ -97,11 +98,19 @@ describe("webui API helpers", () => {
vi.unstubAllGlobals();
});
it("fetches a subagent thread from its parent session", async () => {
await fetchSubagentThread("tok", "websocket:chat-1", "task-1");
expect(fetch).toHaveBeenCalledWith(
"/api/sessions/websocket%3Achat-1/subagents/task-1/webui-thread",
expect.objectContaining({ headers: { Authorization: "Bearer tok" } }),
);
});
it("percent-encodes websocket keys when fetching webui-thread snapshot", async () => {
await fetchWebuiThread("tok", "websocket:chat-1");
expect(fetch).toHaveBeenCalledWith(
"/api/sessions/websocket%3Achat-1/webui-thread",
"/api/sessions/websocket%3Achat-1/webui-thread?include_model_requests=1",
expect.objectContaining({
headers: { Authorization: "Bearer tok" },
credentials: "same-origin",
@@ -117,7 +126,7 @@ describe("webui API helpers", () => {
});
expect(fetch).toHaveBeenCalledWith(
"/api/sessions/websocket%3Achat-1/webui-thread?limit=120&before=abc%2B%2F%3D",
"/api/sessions/websocket%3Achat-1/webui-thread?limit=120&before=abc%2B%2F%3D&include_model_requests=1",
expect.objectContaining({
headers: { Authorization: "Bearer tok" },
credentials: "same-origin",
@@ -163,7 +172,7 @@ describe("webui API helpers", () => {
})).resolves.toBe(cached);
expect(fetch).toHaveBeenCalledWith(
"/api/sessions/websocket%3Achat-1/webui-thread",
"/api/sessions/websocket%3Achat-1/webui-thread?include_model_requests=1",
expect.objectContaining({
headers: {
Authorization: "Bearer tok",