feat(FN-689): sync steps from PROMPT.md in getTask
- Add step synchronization when loading task from database - Sync steps array from PROMPT.md file to keep task metadata in sync - Add test coverage for getTask step sync behavior - Remove terminal session functionality (useTerminalSessions hook and tests) - Clean up unused terminal-related components and CSS
This commit is contained in:
@@ -904,6 +904,31 @@ describe("TaskStore", () => {
|
||||
expect(fetched.description).toBe(task.description);
|
||||
expect(fetched.prompt).toBe("");
|
||||
});
|
||||
|
||||
it("getTask syncs steps from PROMPT.md when task.steps is empty", async () => {
|
||||
const task = await store.createTask({ description: "Test task" });
|
||||
// task.steps should be empty in DB
|
||||
const dir = join(rootDir, ".fusion", "tasks", task.id);
|
||||
await writeFile(
|
||||
join(dir, "PROMPT.md"),
|
||||
`# ${task.id}: Test task
|
||||
|
||||
## Steps
|
||||
|
||||
### Step 0: Preflight
|
||||
- [ ] Check something
|
||||
|
||||
### Step 1: Do the thing
|
||||
- [ ] Do it
|
||||
`,
|
||||
);
|
||||
|
||||
const detail = await store.getTask(task.id);
|
||||
expect(detail.steps).toEqual([
|
||||
{ name: "Preflight", status: "pending" },
|
||||
{ name: "Do the thing", status: "pending" },
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("upsertTask regression coverage", () => {
|
||||
|
||||
Reference in New Issue
Block a user