FN-5703: forward task:deleted events through in-process runtime

Ensure engine-side task deletes propagate through all runtime transports so GitHub tracking cleanup runs consistently.

- extend IPC protocol and child-process runtime/worker plumbing to carry `task:deleted` events
- forward `task:deleted` from in-process runtime through project runtime and project manager dispatch
- add regression coverage for in-process runtime forwarding and GitHub tracking delete handling

Files changed:
 .../src/__tests__/github-tracking-delete.test.ts   | 29 ++++++++++++++++++
 .../src/__tests__/in-process-runtime.test.ts       | 34 +++++++++++++++++++++-
 packages/engine/src/ipc/ipc-protocol.ts            | 14 ++++++++-
 packages/engine/src/project-manager.ts             |  7 +++++
 packages/engine/src/project-runtime.ts             |  4 ++-
 .../engine/src/runtimes/child-process-runtime.ts   |  6 ++++
 .../engine/src/runtimes/child-process-worker.ts    | 14 +++++++--
 packages/engine/src/runtimes/in-process-runtime.ts | 10 ++++++-
 8 files changed, 111 insertions(+), 7 deletions(-)

Fusion-Task-Id: FN-5703

Fusion-Task-Lineage: 1406838b-5abf-4b86-8161-c2dd59f88a9b
This commit is contained in:
gsxdsm
2026-05-29 18:38:43 -07:00
parent dac9b96262
commit a9d2064f66
8 changed files with 111 additions and 7 deletions

View File

@@ -133,6 +133,35 @@ describe("github tracking delete flow", () => {
expect(mockSetIssueState).toHaveBeenCalledWith("octocat", "hello-world", 7, "closed", "not_planned");
});
it("uses task:deleted githubIssueAction=auto metadata to close linked issue", async () => {
const handleTaskDeletedSpy = vi.spyOn(stateService as any, "handleTaskDeleted");
const task = await store.createTask({
description: "delete tracked task with default auto metadata",
githubTracking: { enabled: true },
});
await store.linkGithubIssue(task.id, {
owner: "octocat",
repo: "hello-world",
number: 70,
url: "https://github.com/octocat/hello-world/issues/70",
createdAt: new Date().toISOString(),
});
const closeAction = waitForGithubIssueAction(
store,
(payload) => payload.taskId === task.id && payload.action === "close" && payload.outcome === "success",
{ timeoutMessage: `Timed out waiting for auto close action for deleted task ${task.id}` },
);
await store.deleteTask(task.id, { githubIssueAction: "auto" });
await closeAction;
expect(handleTaskDeletedSpy).toHaveBeenCalled();
expect(handleTaskDeletedSpy).toHaveBeenCalledWith(store, expect.objectContaining({ id: task.id }), { githubIssueAction: "auto" });
expect(mockSetIssueState).toHaveBeenCalledWith("octocat", "hello-world", 70, "closed", "not_planned");
});
it("does not call GitHub when deleting a task with tracking disabled", async () => {
const task = await store.createTask({
description: "delete untracked task",