Repository navigation
fix(workflows): make terminal delivery recoverable - #208
Conversation
tt-a1i
left a comment
There was a problem hiding this comment.
The terminal-first persistence and durable delivery queue are solid improvements, and the Workflow suite plus both CI jobs pass. One terminal-state ownership bug remains blocking:
[P1] Preserve the terminal status already chosen by runScript()/terminalize(). When a detached or released-inline Workflow is canceled, appendArtifactPersistenceFailure() correctly keeps details.status === "aborted" if the final artifact flush also fails, but that persistence error rejects completion. The catch in settleForLaterDelivery() (extensions/workflows/index.ts, currently around line 2156) then unconditionally rewrites the status to failed. The envelope is persisted and delivered with the wrong terminal cause, contradicting this PR's cancellation-preservation contract. Only synthesize failed there if the status is still running (or let the run owner remain authoritative), and add an end-to-end regression covering cancellation plus final persistence failure through the detached/released-inline delivery path rather than only testing the persistence helper directly.
|
已根据 review 修复并推送 commit |
7158600 to
8a3ed53
Compare
tt-a1i
left a comment
There was a problem hiding this comment.
上一轮 P1 已修复:取消加最终 artifact 持久化失败时,磁盘 manifest 和 delivered envelope 都会保留 aborted 与原取消原因;初始 outbox persistence failure、发送失败重试、terminal-first 持久化也有有效覆盖。当前仍有两个 P2:reload E2E 复用了同一实例的内存 pending map,没有证明从持久化状态进行新实例恢复;共享 ResultDeliveryQueue 也没有约束 stable id、receipt、retry、restore 等核心 at-least-once 语义。请按行级评论补齐。当前 head 的本地相关测试 30/30、bun run check 通过,远端两路 CI 通过,但 PR 落后 main。
8a3ed53 to
b5c17b4
Compare
tt-a1i
left a comment
There was a problem hiding this comment.
Re-review on b5c17b4: both requested changes are closed. Reload recovery now constructs a fresh extension instance and proves the persisted pending envelope is sufficient for one delivery. Shared contracts now distinguish consumable one-shot queues from durable at-least-once queues and type stable ids, receipts, restore, and retry. The branch is rebased onto current main. Local bun run check passed; full suite passed with 941 Node and 30 Vitest tests. Remote Node 22.19 and Node 24 CI both passed.
* fix(workflows): make terminal delivery recoverable * fix(workflows): preserve aborted terminal delivery * fix(workflows): close durable delivery review gaps --------- Co-authored-by: tt-a1i <[email protected]> (cherry picked from commit 44210c7)
Summary
Fixes #71. Makes Workflow terminal state and completion delivery recoverable across persistence, transport, and session lifecycle failures.
runningmanifest.abortedstatus and original cancellation reason when artifact persistence also fails.ResultDeliveryQueuecontract for Subagent, Background Terminal, and Workflow delivery implementations.Validation
bun run checknode --test --experimental-strip-types tests/extensions/workflows/*.test.ts(240/240)The local environment could not refresh
origin/mainbecause the SSH connection was closed; the branch was created from the localmaincheckout and pushed to the fork.