feat: strengthen task workflow and compaction recovery

This commit is contained in:
lesetong
2026-07-23 01:23:10 +08:00
parent fe05b278a4
commit 7d876735b2
13 changed files with 380 additions and 81 deletions
+11
View File
@@ -170,6 +170,17 @@ test("tool errors show one summary line until expanded", () => {
assert.deepEqual(expanded, ["✗ Update failed · 2 validation errors", " - first", " - second"]);
});
test("expanded task details tolerate an omitted description", () => {
const state = new TaskState();
state.add([{ name: "Name only" }]);
const result = {
content: [{ type: "text", text: "details" }],
details: { action: "get" as const, snapshot: state.snapshot(), affected: state.list() },
};
const lines = renderToolResult(result, true, plainTheme as never).render(80).map(stripAnsi);
assert.deepEqual(lines, ["✓ 1 task", " ○ 1. Name only", " Parent root · Children none"]);
});
test("snapshot stats count every task node", () => {
assert.deepEqual(snapshotStats(fixture().list()), {
total: 5,