fix(ui): stream phase progress without gates

This commit is contained in:
2026-08-24 12:10:56 +02:00
parent 36a7a0ab33
commit fa2298653b
10 changed files with 186 additions and 5 deletions
+23
View File
@@ -42,6 +42,29 @@ test("real Pi thinking_delta becomes a dedicated activity_delta to the FE", () =
expect(seen).toEqual([{ type: "activity_delta", text: "Valuto le ambiguità" }]);
});
test("a reserved phase notification becomes a structured phase_started event", () => {
const { rpc, fire } = fakeRpc();
const bridge = new SessionBridge(rpc);
const seen: any[] = [];
bridge.onClientEvent((event) => seen.push(event));
fire({
type: "extension_ui_request",
method: "notify",
notifyType: "info",
message: "__tht_phase_started__:F2",
});
fire({
type: "extension_ui_request",
method: "notify",
notifyType: "info",
message: "__tht_phase_started__:F9_DO_NOT_FORWARD",
});
expect(seen).toEqual([{ type: "system_event", event: "phase_started", phase: "F2" }]);
expect(JSON.stringify(seen)).not.toContain("DO_NOT_FORWARD");
});
test("assistant message_end exposes sanitized token usage with the configured context window", () => {
const { rpc, fire } = fakeRpc();
const bridge = new SessionBridge(rpc);