fix(engine): preserve step progress + worktree across internal task bounces
Workflow-step REVISE retries, pause→todo handoffs, and the context-overflow fresh-session requeue were all routing tasks back to `todo` before returning to `in-progress`. The default reopen-to-todo path reset every step to pending and rewrote PROMPT.md checkboxes, so each retry restarted from step 0 even when earlier steps had already been done — the symptom seen on FN-2978, where every workflow REVISE or pause cycle wiped the task's progress. - Add `preserveResumeState` to `TaskStore.moveTask`. When set, skip `resetAllStepsToPending` + `resetPromptCheckboxes` and keep `worktree` and `executionStartedAt` so the resumed run reattaches to the same checkout. `status`, `error`, and `blockedBy` still clear. - Use it on the workflow-rerun bounce, the three pause-graceful handoffs, and the context-overflow requeue. The agent-terminated pause path still discards (it nukes worktree+branch by design). - Context-overflow requeue clears `sessionFile` synchronously in the awaited `updateTask` immediately before `moveTask`, so the next dispatch cannot reopen the saturated session via a stale pointer. - `fn_task_update` no longer silently regresses `done`/`skipped` steps to `in-progress`, no longer captures a stale rewind checkpoint when it does, and tells the agent honestly when a regression is ignored. - Mobile chat keyboard: ChatView/QuickChatFAB gate layout on the new `keyboardOpen` flag so focused-input + viewport-shrink iOS cases still adjust when the computed overlap is zero. Tests: - New `preserveResumeState` coverage in store.test.ts; updated workflow-rerun + pause-graceful assertions in executor.test.ts. - Restructured the previously-flaky "routes exhausted prompt-mode workflow hard failures" test to drive the bounce inline; passes in isolation and in the wider workflow/pause/context sweep (59/59). - Added regression tests in ChatView.test.tsx and QuickChatFAB.test.tsx for the iOS last-resort `keyboardOpen=true, keyboardOverlap=0` case. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
5
.changeset/fn-2978-preserve-step-progress.md
Normal file
5
.changeset/fn-2978-preserve-step-progress.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@runfusion/fusion": patch
|
||||
---
|
||||
|
||||
Stop wiping accumulated step progress and the worktree pointer on internal task bounces. Workflow-step REVISE retries, pause→todo handoffs, and the context-overflow fresh-session requeue all moved tasks back to `todo` before returning to `in-progress`, and the default reopen-to-todo path was resetting every step to `pending` and rewriting PROMPT.md checkboxes — so each retry restarted the agent from step 0 even though earlier steps were already done. `moveTask` now accepts a `preserveResumeState` flag that the executor sets on those internal hops; user-initiated "move back to todo" still gets the clean-slate behavior. The context-overflow path additionally clears `sessionFile` synchronously so the next dispatch can no longer reopen the saturated session. `fn_task_update` no longer silently regresses a `done`/`skipped` step to `in-progress`, no longer captures a stale rewind checkpoint when it does, and tells the agent honestly when a regression is ignored. Mobile chat keyboard handling now keeps the layout adjusted on iOS even when the visual-viewport overlap reads as zero (focused input + viewport shrink).
|
||||
Reference in New Issue
Block a user