fix(channels): reset completed command output detail · openclaw/openclaw@5ee0f13
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -24,7 +24,7 @@ describe("buildChannelProgressDraftLine", () => {
|
24 | 24 | }); |
25 | 25 | }); |
26 | 26 | |
27 | | -it("uses the tool label when successful command output has no title", () => { |
| 27 | +it("uses completed status when successful command output has no title", () => { |
28 | 28 | const line = buildChannelProgressDraftLine({ |
29 | 29 | event: "command-output", |
30 | 30 | phase: "end", |
@@ -34,10 +34,10 @@ describe("buildChannelProgressDraftLine", () => {
|
34 | 34 | |
35 | 35 | expect(line).toMatchObject({ |
36 | 36 | kind: "command-output", |
37 | | -text: "🛠️ Exec", |
| 37 | +text: "🛠️ completed", |
| 38 | +detail: "completed", |
38 | 39 | status: "completed", |
39 | 40 | }); |
40 | | -expect(line?.detail).toBeUndefined(); |
41 | 41 | }); |
42 | 42 | |
43 | 43 | it("keeps command status and title in raw command progress lines", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -444,6 +444,15 @@ function buildCommandOutputProgressLine(
|
444 | 444 | return line; |
445 | 445 | } |
446 | 446 | if (status === "completed") { |
| 447 | +if (!line.detail) { |
| 448 | +const statusLine = { |
| 449 | + ...line, |
| 450 | +detail: status, |
| 451 | +text: formatToolAggregate(name, [status], { markdown: options?.markdown }), |
| 452 | +}; |
| 453 | +setProgressDraftLineCorrelationKey(statusLine, correlationKey); |
| 454 | +return statusLine; |
| 455 | +} |
447 | 456 | return line; |
448 | 457 | } |
449 | 458 | if (!line.detail || line.detail === status) { |
@@ -1144,6 +1153,7 @@ function mergeProgressDraftLineUpdate<TLine extends string | ChannelProgressDraf
|
1144 | 1153 | if ( |
1145 | 1154 | line.kind !== "command-output" || |
1146 | 1155 | !line.status || |
| 1156 | +line.status === "completed" || |
1147 | 1157 | (line.detail && line.detail !== line.status) |
1148 | 1158 | ) { |
1149 | 1159 | return line; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -601,16 +601,16 @@ describe("channel-streaming", () => {
|
601 | 601 | expect(updated[0]).toMatchObject({ |
602 | 602 | id: "tool:call-1-output", |
603 | 603 | kind: "command-output", |
604 | | -detail: "install dependencies", |
| 604 | +detail: "completed", |
605 | 605 | status: "completed", |
606 | | -text: "🛠️ install dependencies", |
| 606 | +text: "🛠️ completed", |
607 | 607 | }); |
608 | 608 | expect( |
609 | 609 | formatChannelProgressDraftText({ |
610 | 610 | lines: updated, |
611 | 611 | entry: { streaming: { progress: { label: false } } }, |
612 | 612 | }), |
613 | | -).toBe("🛠️ install dependencies"); |
| 613 | +).toBe("🛠️ completed"); |
614 | 614 | |
615 | 615 | const recoveredItemLine = buildChannelProgressDraftLine({ |
616 | 616 | event: "item", |
@@ -640,9 +640,9 @@ describe("channel-streaming", () => {
|
640 | 640 | { |
641 | 641 | id: "command-2", |
642 | 642 | kind: "command-output", |
643 | | -detail: "install dependencies failed", |
| 643 | +detail: "completed", |
644 | 644 | status: "completed", |
645 | | -text: "🛠️ install dependencies failed", |
| 645 | +text: "🛠️ completed", |
646 | 646 | }, |
647 | 647 | ]); |
648 | 648 | }); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。