Commit Graph

6718 Commits

Author SHA1 Message Date
Fusion
4c26aa6e91 fix(FN-4811): refuse to force-remove worktrees actively bound to live sessions
The executor's conflict-recovery paths (cleanupConflictingWorktree,
handleBranchConflict, and tryCreateWorktree's live-foreign/stale-resolved
branches) could force-remove a worktree even when it was currently bound
to an active executor session. This caused the FN-4781/FN-4804 cascade:

  - 'Execution blocked: assigned worktree path disappeared mid-task' as
    git deleted the live agent's filesystem out from under it
  - Two parallel runs for the same task alive simultaneously, with the
    second run started in a fresh worktree while the first was still
    holding the old session
  - Cross-task log attribution (an FN-4804 runContext writing to FN-4781)
  - Post-merge 'branch tip misbound but content found on main via trailer'
    rescues firing on every successful merge as the bookkeeping was
    corrupted mid-merge

Adds a hard liveness gate centralized in findActiveWorktreeOwner(), which
checks both the in-memory activeWorktrees map and the DB for non-done,
non-paused, in-progress tasks bound to the worktree. The gate fires at
two points:

  1. cleanupConflictingWorktree returns false (refuses removal) when an
     active owner is found, logging an FN-4811 refusal entry.
  2. handleBranchConflict short-circuits to 'sticky' BEFORE invoking
     inspectBranchConflict, because some inspection branches force-remove
     unconditionally.

When cleanup is refused, the live-foreign and stale-resolved branches in
tryCreateWorktree now FALL THROUGH to the suffix-rename path (rather
than returning null) so the requesting task can still proceed without
disturbing the live owner.

Tests:

  - New reliability-interactions backstop at
    src/__tests__/reliability-interactions/active-worktree-removal-liveness.test.ts
    covers findActiveWorktreeOwner (5 cases: in-memory match, requesting
    task excluded, DB-level match, paused exclusion, terminal-column
    exclusion, self-exclusion), cleanupConflictingWorktree gate (3 cases:
    in-memory refuse, DB refuse, no-owner proceed), and handleBranchConflict
    gate (2 cases: short-circuit + inspection-skipped, no-owner proceeds).
  - Updates existing executor-worktree.test.ts assertion that was
    documenting the bug behavior (force-removing active worktree) to match
    the new contract (refuses + falls through to suffix-rename).

Full engine suite: 307 files, 5035 tests pass.

Fusion-Task-Id: FN-4811
2026-05-16 15:36:07 -07:00
Fusion
3f8a5e6839 fix(FN-4806): silently recover when worktree/branch reclaimed mid-retry
The executor's no-fn_task_done retry loop has two reclaim signals
(retryAbortedDueToReclaim=true): (1) pre-retry liveness recheck where the
task DB shows worktree/branch was cleared, and (2) session-start failure
because the worktree path no longer exists. Both are engine self-heal
situations triggered by FN-4546 stale-active-branch reclaim, FN-4742
self-healing removals, or related housekeeping paths — the agent never
got a fair retry attempt.

Previously these surfaced as task status=failed with error
'Worktree/branch reclaimed during no-fn_task_done retry — requeueing',
fired onError, and burned the taskDoneRetryCount budget. Three legitimate
problems followed: tasks accumulated spurious failures in the UI, the
exhausted-budget branch escalated reclaimed tasks to in-review instead of
retrying, and the noise masked the underlying worktree-removal regression
(FN-4811).

Now the reclaim branch silently:
- clears stale worktree/branch metadata so the next pickup creates a fresh worktree
- requeues to todo with preserveProgress
- logs an informational 'engine self-heal, no failure' line
- does NOT set status=failed, does NOT bump taskDoneRetryCount, does NOT call onError

The genuine 'agent finished without calling fn_task_done after N retries'
exhaustion path (retryAbortedDueToReclaim=false) is unchanged.

Tests updated in
packages/engine/src/__tests__/reliability-interactions/executor-no-task-done-vs-worktree-reclaim.test.ts
to assert the new silent-recovery contract on all three reclaim paths.

Fusion-Task-Id: FN-4806
2026-05-16 15:16:05 -07:00
Fusion (runfusion.ai)
22dbc4951e test(FN-4788): update schema-version assertions to 83
Fusion-Task-Id: FN-4788
Fusion-Task-Lineage: 8de6c7f4-cf0f-4b1f-b664-4e8533b88919
2026-05-16 15:05:15 -07:00
Fusion (runfusion.ai)
9b7550a3f1 test(FN-4788): complete Step 4 — add secrets schema coverage
Fusion-Task-Id: FN-4788
Fusion-Task-Lineage: 8de6c7f4-cf0f-4b1f-b664-4e8533b88919
2026-05-16 15:05:15 -07:00
Fusion (runfusion.ai)
7f294614b5 feat(FN-4788): complete Step 2 — add central secrets_global schema migration
Fusion-Task-Id: FN-4788
Fusion-Task-Lineage: 8de6c7f4-cf0f-4b1f-b664-4e8533b88919
2026-05-16 15:05:15 -07:00
Fusion (runfusion.ai)
268eec50a9 feat(FN-4788): complete Step 1 — add project secrets schema migration
Fusion-Task-Id: FN-4788
Fusion-Task-Lineage: 8de6c7f4-cf0f-4b1f-b664-4e8533b88919
2026-05-16 15:05:15 -07:00
Fusion (runfusion.ai)
5bb15b1713 test(FN-4803): stabilize cli bundled plugin integration timeout
Fusion-Task-Id: FN-4803
Fusion-Task-Lineage: cbfa10fd-33a6-469c-9cb4-3a647bc47b84
2026-05-16 14:56:56 -07:00
Fusion (runfusion.ai)
246609a415 feat(FN-4803): complete Steps 4-5 — docs update and changeset
Fusion-Task-Id: FN-4803
Fusion-Task-Lineage: cbfa10fd-33a6-469c-9cb4-3a647bc47b84
2026-05-16 14:56:56 -07:00
Fusion (runfusion.ai)
5204177c2b test(FN-4803): complete Step 3 — cover github dedup toggle behavior
Fusion-Task-Id: FN-4803
Fusion-Task-Lineage: cbfa10fd-33a6-469c-9cb4-3a647bc47b84
2026-05-16 14:56:56 -07:00
Fusion (runfusion.ai)
371b1be7f7 feat(FN-4803): complete Step 1 — add dedup toggle in settings modal
Fusion-Task-Id: FN-4803
Fusion-Task-Lineage: cbfa10fd-33a6-469c-9cb4-3a647bc47b84
2026-05-16 14:56:56 -07:00
gsxdsm
f313000362 chore: ignore desktop packaging artifacts
Add dist-electron/ and common installer artifact patterns (*.dmg,
*.zip blockmaps, *.AppImage, etc.) to .gitignore so electron-builder
output never gets staged into commits.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 14:56:30 -07:00
Fusion (runfusion.ai)
bb3f204a7d test(FN-4787): fix dashboard loader duplicate mock declaration
Fusion-Task-Id: FN-4787
Fusion-Task-Lineage: 9f174f4f-d305-4779-ba0d-562f2eab064c
2026-05-16 14:23:14 -07:00
Fusion (runfusion.ai)
b57d3bcc0c test(FN-4787): regression tests for heartbeat identity snapshot
Fusion-Task-Id: FN-4787
Fusion-Task-Lineage: 9f174f4f-d305-4779-ba0d-562f2eab064c
2026-05-16 14:23:14 -07:00
Fusion (runfusion.ai)
7cdd27feae fix(FN-4787): disambiguate identity snapshot soul/instructions/memory states
Fusion-Task-Id: FN-4787
Fusion-Task-Lineage: 9f174f4f-d305-4779-ba0d-562f2eab064c
2026-05-16 14:23:14 -07:00
Fusion (runfusion.ai)
fea0b51915 feat(FN-4783): complete Step 8 — documentation and changeset
Fusion-Task-Id: FN-4783
Fusion-Task-Lineage: 7a02897b-e303-4947-86b2-3dd7a343f653
2026-05-16 13:46:43 -07:00
Fusion (runfusion.ai)
415cd6a111 test(FN-4783): stabilize workspace test lanes for verification
Fusion-Task-Id: FN-4783
Fusion-Task-Lineage: 7a02897b-e303-4947-86b2-3dd7a343f653
2026-05-16 13:46:43 -07:00
Fusion (runfusion.ai)
3c272cda63 feat(FN-4783): complete Step 6 — expose oauth expiry notification toggle
Fusion-Task-Id: FN-4783
Fusion-Task-Lineage: 7a02897b-e303-4947-86b2-3dd7a343f653
2026-05-16 13:46:42 -07:00
Fusion (runfusion.ai)
5e159368dc feat(FN-4783): complete Steps 4-5 — provider rendering and engine wiring
Fusion-Task-Id: FN-4783
Fusion-Task-Lineage: 7a02897b-e303-4947-86b2-3dd7a343f653
2026-05-16 13:46:42 -07:00
Fusion (runfusion.ai)
b48f8f1fac feat(FN-4783): complete Step 2 — add OAuth expiry monitor
Fusion-Task-Id: FN-4783
Fusion-Task-Lineage: 7a02897b-e303-4947-86b2-3dd7a343f653
2026-05-16 13:46:42 -07:00
Fusion (runfusion.ai)
f8c050741c feat(FN-4783): complete Step 1 — add oauth token expired event types
Fusion-Task-Id: FN-4783
Fusion-Task-Lineage: 7a02897b-e303-4947-86b2-3dd7a343f653
2026-05-16 13:46:42 -07:00
Fusion (runfusion.ai)
fc86c4f429 feat(FN-4784): complete Step 4 — add changeset
Fusion-Task-Id: FN-4784
Fusion-Task-Lineage: e11a4758-93ab-451e-8721-ae8995aaa70d
2026-05-16 13:35:31 -07:00
Fusion (runfusion.ai)
8b6b4cfeb1 test(FN-4784): complete Step 2 — codex precedence coverage
Fusion-Task-Id: FN-4784
Fusion-Task-Lineage: e11a4758-93ab-451e-8721-ae8995aaa70d
2026-05-16 13:35:31 -07:00
Fusion (runfusion.ai)
fd01843d40 feat(FN-4784): complete Step 1 — prefer Fusion Codex OAuth
Fusion-Task-Id: FN-4784
Fusion-Task-Lineage: e11a4758-93ab-451e-8721-ae8995aaa70d
2026-05-16 13:35:28 -07:00
Fusion (runfusion.ai)
424c61f4f7 feat(FN-4780): complete Step 7 — add changeset
Fusion-Task-Id: FN-4780
Fusion-Task-Lineage: 7f052539-9d15-4997-8135-21434f065d4a
2026-05-16 13:24:56 -07:00
Fusion (runfusion.ai)
f3901808ed feat(FN-4780): complete Step 5 — clear SWR caches on version update
Fusion-Task-Id: FN-4780
Fusion-Task-Lineage: 7f052539-9d15-4997-8135-21434f065d4a
2026-05-16 13:24:56 -07:00
Fusion (runfusion.ai)
508ab73486 feat(FN-4780): complete Step 4 — cache hydrate useTasks
Fusion-Task-Id: FN-4780
Fusion-Task-Lineage: 7f052539-9d15-4997-8135-21434f065d4a
2026-05-16 13:24:52 -07:00
Fusion (runfusion.ai)
b073f4ab27 feat(FN-4780): complete Step 3 — hydrate useCurrentProject from cache
Fusion-Task-Id: FN-4780
Fusion-Task-Lineage: 7f052539-9d15-4997-8135-21434f065d4a
2026-05-16 13:24:51 -07:00
Fusion (runfusion.ai)
432d2e5e37 feat(FN-4780): complete Step 2 — hydrate useProjects from cache
Fusion-Task-Id: FN-4780
Fusion-Task-Lineage: 7f052539-9d15-4997-8135-21434f065d4a
2026-05-16 13:24:51 -07:00
Fusion (runfusion.ai)
167b2cf0c9 feat(FN-4780): complete Step 1 — add swr cache utility
Fusion-Task-Id: FN-4780
Fusion-Task-Lineage: 7f052539-9d15-4997-8135-21434f065d4a
2026-05-16 13:24:50 -07:00
gsxdsm
a679df7d1c fix(desktop): set productName so Electron uses Fusion as app name
Without productName, Electron's app.getName() returns the package
name "@fusion/desktop", which macOS uses for the user-data dir and
some app surfaces. Setting productName=Fusion aligns runtime naming
with the electron-builder productName and the Info.plist bundle name.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 13:21:57 -07:00
Fusion (runfusion.ai)
a2710fb70f test(FN-4802): stabilize desktop auto-updater setup assertions
Fusion-Task-Id: FN-4802
Fusion-Task-Lineage: a1436633-8000-4b3a-8d22-dcc28be69bcd
2026-05-16 13:15:00 -07:00
Fusion (runfusion.ai)
63502600db fix(FN-4802): align hybridExecutor type with createServer signature
Fusion-Task-Id: FN-4802
Fusion-Task-Lineage: a1436633-8000-4b3a-8d22-dcc28be69bcd
2026-05-16 13:15:00 -07:00
gsxdsm
f84c048fe2 fix(desktop): bundle electron-updater into main.js
esbuild now bundles main.ts with electron-updater (and its transitive
deps) inline, externalizing only electron, workspace packages, and the
native better-sqlite3. This sidesteps the pnpm hoisting issue where
electron-updater's transitive `ms` lived only inside the .pnpm content
store and never landed in the packaged app.asar, leaving the in-app
updater non-functional.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 13:07:02 -07:00
Fusion (runfusion.ai)
5a101dc70b feat(FN-4785): complete Step 6 — document and ship agents-load perf fix
Fusion-Task-Id: FN-4785
Fusion-Task-Lineage: be241ee7-9df0-433c-a00b-997bcd558862
2026-05-16 13:04:28 -07:00
Fusion (runfusion.ai)
416bd8b1f5 feat(FN-4785): complete Step 6 — add changeset for agents load perf
Fusion-Task-Id: FN-4785
Fusion-Task-Lineage: be241ee7-9df0-433c-a00b-997bcd558862
2026-05-16 13:04:28 -07:00
Fusion (runfusion.ai)
3668927042 feat(FN-4785): complete Step 2-3 — batch agent task and run lookups
Fusion-Task-Id: FN-4785
Fusion-Task-Lineage: be241ee7-9df0-433c-a00b-997bcd558862
2026-05-16 13:04:28 -07:00
Fusion (runfusion.ai)
be54c75533 feat(FN-4785): complete Step 3 — batch agent run status aggregation
Fusion-Task-Id: FN-4785
Fusion-Task-Lineage: be241ee7-9df0-433c-a00b-997bcd558862
2026-05-16 13:04:28 -07:00
Fusion (runfusion.ai)
7aeb7583f4 feat(FN-4785): complete Step 2 — batch sanitize agent task link lookups
Fusion-Task-Id: FN-4785
Fusion-Task-Lineage: be241ee7-9df0-433c-a00b-997bcd558862
2026-05-16 13:04:28 -07:00
Fusion (runfusion.ai)
3dfa162f03 feat(FN-4785): complete Step 1 — add getTaskColumns test coverage
Fusion-Task-Id: FN-4785
Fusion-Task-Lineage: be241ee7-9df0-433c-a00b-997bcd558862
2026-05-16 13:04:27 -07:00
Fusion (runfusion.ai)
5ca7f45fe1 feat(FN-4785): complete Step 1 — add batched task column lookup
Fusion-Task-Id: FN-4785
Fusion-Task-Lineage: be241ee7-9df0-433c-a00b-997bcd558862
2026-05-16 13:04:27 -07:00
Fusion (runfusion.ai)
d89a4569f1 fix(FN-4777): add dedup default setting and lint-safe regex
Fusion-Task-Id: FN-4777
Fusion-Task-Lineage: ed00f639-c928-4c14-be1f-2b43db6022c7
2026-05-16 12:56:31 -07:00
Fusion (runfusion.ai)
023a0cc6bd feat(FN-4777): complete Step 6 — add changeset
Fusion-Task-Id: FN-4777
Fusion-Task-Lineage: ed00f639-c928-4c14-be1f-2b43db6022c7
2026-05-16 12:56:31 -07:00
Fusion (runfusion.ai)
a962d42fbb feat(FN-4777): complete Step 5 — document dedup project setting
Fusion-Task-Id: FN-4777
Fusion-Task-Lineage: ed00f639-c928-4c14-be1f-2b43db6022c7
2026-05-16 12:56:31 -07:00
Fusion (runfusion.ai)
1ca873f64e test(FN-4777): complete Step 4 — add dedup tracking coverage
Fusion-Task-Id: FN-4777
Fusion-Task-Lineage: ed00f639-c928-4c14-be1f-2b43db6022c7
2026-05-16 12:56:31 -07:00
Fusion (runfusion.ai)
f60dde01fe feat(FN-4777): complete Step 3 — wire GitHub tracking dedup pre-check
Fusion-Task-Id: FN-4777
Fusion-Task-Lineage: ed00f639-c928-4c14-be1f-2b43db6022c7
2026-05-16 12:56:31 -07:00
Fusion (runfusion.ai)
de5a5c91d4 feat(FN-4777): complete Step 2 — add tracking dedup helper module
Fusion-Task-Id: FN-4777
Fusion-Task-Lineage: ed00f639-c928-4c14-be1f-2b43db6022c7
2026-05-16 12:56:31 -07:00
Fusion (runfusion.ai)
a6b1d59a0c fix(FN-4777): handle gh search all-state without invalid flag
Fusion-Task-Id: FN-4777
Fusion-Task-Lineage: ed00f639-c928-4c14-be1f-2b43db6022c7
2026-05-16 12:56:31 -07:00
Fusion (runfusion.ai)
cfb44af446 feat(FN-4777): complete Step 1 — add GitHub issue search API
Fusion-Task-Id: FN-4777
Fusion-Task-Lineage: ed00f639-c928-4c14-be1f-2b43db6022c7
2026-05-16 12:56:30 -07:00
gsxdsm
6dde53ff0d fix(desktop): app icon + harden auto-updater loading
Generate a 1024x1024 macOS app icon from the dashboard logo so packaged
builds carry the Fusion brand instead of the default Electron icon, and
load electron-updater dynamically inside a try/catch so packaged builds
tolerate CJS/ESM interop quirks and missing transitive deps. Widen the
electron-builder files whitelist to include electron-updater's
transitive dep tree so they are actually bundled into the asar.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 12:51:12 -07:00
gsxdsm
c6e978286a feat(FN-4779): merge fusion/fn-4779 2026-05-16 12:49:57 -07:00