Skip to content

Commit 583a60f

Browse files
TurboTheTurtleclawsweeper[bot]Takhoffman
authored
fix(ui): render session-scoped tool events (#83734)
Summary: - The PR routes `session.tool` Gateway frames through the Control UI tool-stream handler, adds a regression test, and adds a changelog entry. - Reproducibility: yes. Current main emits `session.tool` frames for session subscribers, but the Control UI d ... to the tool-stream handler, so the failure path is source-reproducible without needing a live browser run. Automerge notes: - PR branch already contained follow-up commit before automerge: fix(ui): render session-scoped tool events Validation: - ClawSweeper review passed for head 58be438. - Required merge gates passed before the squash merge. Prepared head SHA: 58be438 Review: #83734 (comment) Co-authored-by: Andy Ye <35905412+TurboTheTurtle@users.noreply.github.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: takhoffman Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
1 parent 94abfa7 commit 583a60f

3 files changed

Lines changed: 35 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Docs: https://docs.openclaw.ai
4848
### Fixes
4949

5050
- Agents/subagents: keep collect-mode announce queues batching unresolved-origin items with compatible same-route messages and resume collection after a true cross-channel drain when a later compatible batch remains. Fixes #83577.
51+
- Control UI: render live tool progress from session-scoped `session.tool` Gateway events so externally started runs show their tool cards in the active session. (#83734) Thanks @TurboTheTurtle.
5152
- Browser: enforce current-tab URL allowlist checks for `/act` evaluate/batch actions and `/highlight` routes while leaving tab-management actions unblocked. (#78523)
5253
- CI: require real-behavior-proof verdict markers to come from the ClawSweeper GitHub App before accepting exact-head proof. (#83692)
5354
- Models: show the effective OpenAI/Codex auth profile in `/models` provider headers instead of falling back to the OpenAI env-key label. (#83697) Thanks @yu-xin-c.

ui/src/ui/app-gateway.node.test.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,39 @@ describe("connectGateway", () => {
936936
expect(loadChatHistoryMock).not.toHaveBeenCalled();
937937
});
938938

939+
it("renders session-scoped tool events for externally started runs", () => {
940+
const { host, client } = connectHostGateway();
941+
942+
client.emitEvent({
943+
event: "session.tool",
944+
payload: {
945+
runId: "external-run-1",
946+
seq: 1,
947+
stream: "tool",
948+
ts: 123,
949+
sessionKey: "main",
950+
data: {
951+
toolCallId: "session-tool-1",
952+
name: "exec",
953+
phase: "start",
954+
args: { command: "pwd" },
955+
},
956+
},
957+
});
958+
959+
expect(host.toolStreamOrder).toStrictEqual(["session-tool-1"]);
960+
const entry = host.toolStreamById.get("session-tool-1") as
961+
| { args?: unknown; name?: string; runId?: string; sessionKey?: string }
962+
| undefined;
963+
expect(entry).toMatchObject({
964+
args: { command: "pwd" },
965+
name: "exec",
966+
runId: "external-run-1",
967+
sessionKey: "main",
968+
});
969+
expect(loadChatHistoryMock).not.toHaveBeenCalled();
970+
});
971+
939972
it("stores BTW side results for the active session", () => {
940973
const { host, client } = connectHostGateway();
941974

ui/src/ui/app-gateway.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ function handleGatewayEventUnsafe(host: GatewayHost, evt: GatewayEventFrame) {
860860
host.eventLog = host.eventLogBuffer;
861861
}
862862

863-
if (evt.event === "agent") {
863+
if (evt.event === "agent" || evt.event === "session.tool") {
864864
if (host.onboarding) {
865865
return;
866866
}

0 commit comments

Comments
 (0)