feat(coding-agent/task): added parent-aware labels to nested live task snapshots
- Updated nested task-rendering tests to use parent-qualified IDs for completed child task results. - Updated in-flight nested snapshot expectations to verify parent-aware `Parent>Subtask` labeling. - Documented the live nested task rendering behavior in the package changelog.
This commit is contained in:
@@ -90,14 +90,15 @@ describe("task renderer: nested live rendering", () => {
|
||||
|
||||
it("renders completed nested task results stored in extractedToolData.task while parent is in-progress", async () => {
|
||||
const parent = makeRunningProgress({
|
||||
id: "1-Parent",
|
||||
recentTools: [{ tool: "task", args: "", endMs: Date.now() }],
|
||||
extractedToolData: {
|
||||
task: [
|
||||
{
|
||||
projectAgentsDir: null,
|
||||
results: [
|
||||
makeCompletedSubResult("1.0-AlphaSub", "Alpha child"),
|
||||
makeCompletedSubResult("1.1-BetaSub", "Beta child"),
|
||||
makeCompletedSubResult("1-Parent.0-AlphaSub", "Alpha child"),
|
||||
makeCompletedSubResult("1-Parent.1-BetaSub", "Beta child"),
|
||||
],
|
||||
totalDurationMs: 1000,
|
||||
} satisfies TaskToolDetails,
|
||||
@@ -109,11 +110,12 @@ describe("task renderer: nested live rendering", () => {
|
||||
|
||||
// Parent label is intact.
|
||||
expect(text).toContain("Parent Level 1 work");
|
||||
// Both nested completed children labels surface.
|
||||
// Both nested completed children labels surface (formatTaskId collapses
|
||||
// dotted ids → "1.0 Parent>AlphaSub").
|
||||
expect(text).toContain("Alpha child");
|
||||
expect(text).toContain("Beta child");
|
||||
expect(text).toContain("1.0 AlphaSub");
|
||||
expect(text).toContain("1.1 BetaSub");
|
||||
expect(text).toContain("1.0 Parent>AlphaSub");
|
||||
expect(text).toContain("1.1 Parent>BetaSub");
|
||||
});
|
||||
|
||||
it("renders the in-flight nested task snapshot (progress[]) before the call ends", async () => {
|
||||
@@ -122,11 +124,12 @@ describe("task renderer: nested live rendering", () => {
|
||||
results: [],
|
||||
totalDurationMs: 0,
|
||||
progress: [
|
||||
makeRunningSubProgress("2.0-GammaSub", "Gamma child running"),
|
||||
makeRunningSubProgress("2.1-DeltaSub", "Delta child running"),
|
||||
makeRunningSubProgress("2-Parent.0-GammaSub", "Gamma child running"),
|
||||
makeRunningSubProgress("2-Parent.1-DeltaSub", "Delta child running"),
|
||||
],
|
||||
};
|
||||
const parent = makeRunningProgress({
|
||||
id: "2-Parent",
|
||||
currentTool: "task",
|
||||
currentToolStartMs: Date.now(),
|
||||
inflightTaskDetails: inflight,
|
||||
@@ -137,8 +140,8 @@ describe("task renderer: nested live rendering", () => {
|
||||
expect(text).toContain("Parent Level 1 work");
|
||||
expect(text).toContain("Gamma child running");
|
||||
expect(text).toContain("Delta child running");
|
||||
expect(text).toContain("2.0 GammaSub");
|
||||
expect(text).toContain("2.1 DeltaSub");
|
||||
expect(text).toContain("2.0 Parent>GammaSub");
|
||||
expect(text).toContain("2.1 Parent>DeltaSub");
|
||||
});
|
||||
|
||||
it("combines completed and in-flight nested snapshots in one tree", async () => {
|
||||
|
||||
Reference in New Issue
Block a user