Commit Graph

61 Commits

Author SHA1 Message Date
gsxdsm
f21e7699d5 chore(release): v0.11.0
Version bump via changesets.
2026-04-30 21:44:17 -07:00
gsxdsm
b1c0912320 chore(release): v0.10.0
Version bump via changesets.
2026-04-30 17:41:33 -07:00
gsxdsm
f11860619f test(pi-claude-cli): cover async CLI validation probes
Adds vitest coverage for validateCliPresenceAsync and validateCliAuthAsync,
verifying success paths, spawn-error paths, non-zero exit codes, and that
auth failures emit the expected warning. Pairs with the async/memoized
validation refactor in f7df0d4e3 that unblocks the dashboard event loop
on every chat send.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 10:01:53 -07:00
gsxdsm
f7df0d4e34 chore: remove changeset negation rules from .gitignore
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-30 08:36:32 -07:00
gsxdsm
26a286973a chore(release): v0.9.4
Version bump via changesets.
2026-04-30 04:45:06 -07:00
gsxdsm
2abc68635f chore(release): v0.9.3
Version bump via changesets.
2026-04-29 23:20:40 -07:00
gsxdsm
d2b688ed14 chore(release): v0.9.2
Version bump via changesets.
2026-04-29 22:27:14 -07:00
gsxdsm
ba2cb2bd72 chore(release): v0.9.1
Version bump via changesets.
2026-04-29 16:29:16 -07:00
gsxdsm
061a7dce35 chore(release): v0.9.0
Version bump via changesets.
2026-04-29 14:04:09 -07:00
gsxdsm
afd48c2cc4 test(FN-2360): harden test isolation around repo fusion state 2026-04-29 12:02:56 -07:00
gsxdsm
262c6d8a4a chore(release): v0.8.4
Version bump via changesets.
2026-04-29 08:59:49 -07:00
gsxdsm
bd14cf84e3 fix(FN-XXX): harden windows path handling 2026-04-29 07:35:23 -07:00
Fusion
995165ea60 feat(FN-2944): merge fusion/fn-2944
- test(FN-2944): cover already checked out worktree conflict recovery
- fix(FN-2944): recognize git already checked out worktree conflict
- fix(engine): auto-recover from squash-merge orphan rebase failures

Fusion-Task-Id: FN-2944
2026-04-29 07:10:52 -07:00
Fusion
e4dee503c5 feat(FN-2938): merge fusion/fn-2938
- fix(FN-2938): satisfy lint for control-request debug logging
- test(FN-2938): complete Step 4 — update protocol regression tests
- feat(FN-2938): complete Step 3 — remove stdin control request routing
- feat(FN-2938): complete Step 2 — make control handler pure
- feat(FN-2938): complete Step 1 — fix stdin EOF and spawn flags
- feat(FN-2929): merge fusion/fn-2929

Fusion-Task-Id: FN-2938
2026-04-29 02:07:35 -07:00
gsxdsm
4446a58b05 chore(release): v0.8.3
Version bump via changesets.
2026-04-28 22:02:56 -07:00
gsxdsm
2fd840def5 chore(release): v0.8.2
Version bump via changesets.
2026-04-28 21:51:32 -07:00
gsxdsm
901d61fa85 fix(cli): validate agentId in fn_task_create/update and unblock bundle tests
fn_task_create and fn_task_update accepted any string as `agentId` and
wrote it verbatim onto `task.assignedAgentId`, letting hallucinated IDs
(e.g. `agent-executor-001`) appear as agent badges in the dashboard.
Mirror the validation already used by fn_delegate: look the agent up via
AgentStore and reject unknown or ephemeral/runtime-managed agents. Null
still clears the field on update.

Also clean up two stale failures in bundle-output.test that predated this
change:
- pi-claude-cli no longer imports cross-spawn, so drop the dependency and
  its orphan type-decl file.
- Loosen the spawn-import regex to match `spawn` anywhere in the
  destructured import (the source has additional named imports).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 21:34:34 -07:00
gsxdsm
765e41838c chore(release): v0.8.1
Version bump via changesets.
2026-04-28 21:15:15 -07:00
Fusion
7650f2d2d9 feat(FN-2909): merge fusion/fn-2909 2026-04-28 20:07:54 -07:00
gsxdsm
3b54a03b81 chore(release): v0.8.0
Version bump via changesets.
2026-04-28 19:24:57 -07:00
Fusion
ab910a2b0a feat(FN-2898): expand Claude model coverage and subprocess diagnostics
- Add missing Claude model entries and extend provider metadata handling for model extras
- Improve subprocess diagnostics in pi-claude-cli process management for clearer failure visibility
- Add targeted tests for provider model extras and process-manager diagnostic behavior
- Update Settings modal copy for project default model guidance and record changes in pi-claude-cli changelog

Fusion-Task-Id: FN-2898
2026-04-28 18:38:41 -07:00
Fusion
5cc7597b5f fix(FN-2897): harden npm bundle packaging and merge recovery flows
- Strip private @fusion/* workspace devDependencies from the published CLI manifest via prepare-publish-manifest and package metadata updates
- Replace cross-spawn usage and add staged bundle layout assertions to verify resolver output in dist packaging
- Add per-task/project model override resolution across core, dashboard settings/task modals, and route coverage with new regression tests
- Strengthen engine merge/recovery handling for paused/interrupted/squash paths and surface merger timeline activity with additional self-healing and merger tests
- Add changesets for npm bundle dependency fixes, project model override stabilization, and FTS5 corruption recovery

Fusion-Task-Id: FN-2897
2026-04-28 18:23:21 -07:00
gsxdsm
2029968d23 fix(FN-2662): honor project model overrides and stabilize tests 2026-04-28 18:21:17 -07:00
gsxdsm
ad4690329a chore(release): v0.7.1
Version bump via changesets.
2026-04-28 00:36:24 -07:00
gsxdsm
4a3a8dce7c chore(release): v0.7.0
Version bump via changesets.
2026-04-27 22:34:32 -07:00
Fusion
637f4350c9 feat(FN-2703): support custom MCP tools in plan generation
- Remove ToolSearch prerequisite so custom MCP tools can be used during triage and plan generation flows
- Align built-in tool sets between provider wiring and prompt builder handling, including custom ls behavior
- Expand pi-claude-cli tests for event bridge, MCP config, prompt builder, and tool mapping regressions
- Add FN-2703 changeset and delivery documentation for the published @runfusion/fusion package
2026-04-27 09:51:49 -07:00
gsxdsm
5162531275 chore(release): v0.6.0
Version bump via changesets.
2026-04-26 21:27:49 -07:00
gsxdsm
1dddf3252c chore(release): v0.5.0
Manual version bump to 0.5.0 (changeset version produced 1.0.0 from a
single minor changeset against 0.4.1; that release was rolled back and
the 1.0.0 npm version deprecated).

Aggregates: status terminology refresh (planning/replan), Reviewer
rename, in-review pause behavior, dashboard-tui resize hardening,
dev-server experimental toggle fix, version reporting fix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 17:31:46 -07:00
gsxdsm
45002257fd Revert "chore(release): v1.0.0"
This reverts commit 26e09c7aa0.
2026-04-26 17:26:56 -07:00
gsxdsm
26e09c7aa0 chore(release): v1.0.0
Version bump via changesets.
2026-04-26 17:25:49 -07:00
Fusion
9dabeda5da feat(FN-2618): merge fusion/fn-2618
- test(FN-2618): harden process-manager fs/tmpdir mocks
- fix(cli): mark react-devtools-core external in bun compile
- fix(pty): switch to @homebridge/node-pty-prebuilt-multiarch fork
2026-04-26 15:33:39 -07:00
Fusion
861fb50df1 feat(FN-2614): merge fusion/fn-2614 (auto-resolved)
- feat(FN-2614): complete Step 4 — configure vitest test isolation setup
- test(FN-2614): complete Step 3 — add isolation companion test
- feat(FN-2614): complete Step 2 — add test home isolation setup
2026-04-26 14:31:41 -07:00
gsxdsm
80514718ed chore(release): v0.4.1
Version bump via changesets.
2026-04-26 12:24:08 -07:00
gsxdsm
ec3e2cb280 fix(FN-2586): restore 0.4.x release line and agent log stability 2026-04-26 12:22:06 -07:00
Fusion
82cd58fe13 feat(FN-2579): merge fusion/fn-2579 (auto-resolved)
- fix(FN-2579): complete Step 3 — refine split-button accessibility
- fix(FN-2579): resolve workspace lint regression in provider
- test(FN-2579): complete Step 2 — update header engine control tests
- feat(FN-2579): complete Step 1 — style engine split-button dropdown
- feat(FN-2579): complete Step 0 — add engine control split-button behavior
- chore(release): v1.0.0
2026-04-26 00:29:19 -07:00
Fusion
cddf7bbd64 fix(FN-2581): align done timer duration with task lifecycle timestamps
- Update TaskCard done-duration calculations to use createdAt as the start baseline for completed tasks
- Refactor TaskCard timer tests to assert against TaskStore-backed timestamps and avoid brittle elapsed-time assumptions
- Cover done-state timer behavior with expanded test scenarios for start/end timestamp combinations
- Remove unused provider code in pi-claude-cli to satisfy lint and keep the full test/build gates green
2026-04-26 00:26:48 -07:00
gsxdsm
7bc8cf945f chore(release): v0.3.0
Version bump via changesets (consumed 11 changesets). Forced 0.3.0
instead of changesets' default escalation to 1.0.0 for the pre-1.0
minor bump.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 00:15:09 -07:00
gsxdsm
c1a2b6edd7 fix(pi-claude-cli): unblock parameterless MCP tool calls in triage
Triage with claude-sonnet-4-6 via pi-claude-cli kept looping on
fn_review_spec calls that were rejected by pi's validator with
"root: must be object". Parameterless MCP tools (schema
{type:"object", properties:{}}) emit zero input_json_delta events,
so partialJson stayed "" and the catch fell through to
finalArgs = "" — a string, which TypeBox's Type.Object({}) rightly
refuses. Default empty partialJson to {} so the call lands.

Also:
- Add a 2-step reminder loop in triage before swapping to the
  fallback planning model — primary models that wrote PROMPT.md
  but forgot fn_review_spec recover from a nudge, no need to pay
  the cold-start tax of a new triage on a different model.
- Inject @runfusion/fusion's own pi extension into dashboard/
  daemon/serve sessions and propagate the path to createFnAgent
  via setHostExtensionPaths so fn_* tools register globally
  without requiring `pi install npm:@runfusion/fusion`.
- Drop the "historical" qualifier from replayed tool labels —
  Claude was reading "TOOL RESULT (historical Read):" as
  "previous session, ignore" and looping on verification.
- Remove subprocess-lifecycle stderr debug logs that landed for
  hang diagnosis — root cause is fixed, the noise can go.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 00:00:49 -07:00
gsxdsm
7199e64a11 chore(pi-claude-cli): instrument subprocess lifecycle for hang diagnosis
Triage runs through pi-claude-cli still hang silently for 20+ minutes after
only 2 thinking-deltas before the engine's StuckTaskDetector kills them. We
can't tell from agentLogEntries whether the subprocess crashed, the MCP
server failed to attach, or Claude is in extended thinking that doesn't
stream.

Adds stderr lines tagged [pi-claude-cli] for:
- spawn (pid, model, mode, prompt sizes, mcp on/off)
- init (session id, model, permissionMode, mcp_servers status list)
- first-stdout-line (latency from spawn)
- tool_use (per top-level tool, with piKnown flag)
- break-early (when we kill at message_stop)
- close (exit code, signal, elapsed, broken-flag)

No behavioural change. Restart the dashboard, trigger triage, and these
lines tell us which phase silence sets in.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 20:22:57 -07:00
gsxdsm
f0e3413b69 fix(pi-claude-cli): defer to engine StuckTaskDetector instead of 300s subprocess kill
The engine already runs a StuckTaskDetector with a configurable per-task
heartbeat (default 1 hour) and aborts triage/executor sessions through
AbortSignal when it judges them quiet. pi-claude-cli forwards that signal to
the subprocess. The 300s subprocess-level inactivity timeout was a redundant,
much-tighter shadow that kept killing Sonnet 4.6 mid-thinking on the 40k-char
triage prompt — exactly what the engine-level detector is designed not to do.

Move the local timeout to 30 minutes purely as a last-resort guard for embeds
that don't pass an abort signal. Stuck-detection responsibility now lives in
the caller, where it can be configured per task.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 17:49:09 -07:00
gsxdsm
02e54b290c fix(pi-claude-cli): bump inactivity timeout from 180s to 300s
Sonnet 4.6 with extended thinking on the triage prompt (~40k chars + AGENTS.md
+ skills) can take >3 minutes between thinking deltas. The 180s inactivity
timeout was killing those subprocesses before they could finish PROMPT.md +
fn_review_spec, leaving triage looping into the fallback model. Bump to 5
minutes.

Test mock timings updated to match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 17:38:36 -07:00
gsxdsm
ff83adcc5d fix(core): sync default-triage prompt with engine's TRIAGE_SYSTEM_PROMPT
Root cause of "fn_review_spec was never called" tracked through the diagnostic
chain: the prompt actually sent to triage agents has zero `fn_*` tokens —
because resolveAgentPrompt("triage", ...) returns the BUILTIN_AGENT_PROMPTS
default-triage template (TRIAGE_PROMPT_TEXT in core/agent-prompts.ts), and that
template was forked from an older version that never had the "MUST call
fn_review_spec()" workflow nor any fn_-prefixed tool names. The fallback
`|| TRIAGE_SYSTEM_PROMPT` in engine/triage.ts never fires because the core
template is non-empty.

So the model writes PROMPT.md, doesn't see any instruction to review it, and
ends. zai/glm-5.1 happened to call fn_review_spec from training-pattern
inertia; Sonnet via pi-claude-cli stopped at write — same prompt, same bug.

Replace TRIAGE_PROMPT_TEXT with the engine's up-to-date TRIAGE_SYSTEM_PROMPT
verbatim (fn_-prefixed tools, fn_review_spec workflow, subtask breakdown,
project-commands handling, frontend UX criteria injection). Also remove the
diagnostic-only console.error lines added during this debugging session — the
core fix is now elsewhere and the noise isn't worth keeping.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 17:24:03 -07:00
gsxdsm
c5ac9ed880 chore(pi-claude-cli): show fn_* tokens found in prompt for diagnostic
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 17:14:56 -07:00
gsxdsm
bd6a327daf chore(pi-claude-cli): include prompt head + custom names in rewrite diagnostic
User reports "no custom tool refs to rewrite (tools=18)" — meaning Context.tools
is populated but the prompt body doesn't contain any of the names. Need the
first 200 chars of the prompt and a sample of custom-tool names to figure out
whether the engine's customPrompt is reaching us at all or whether names
differ from what we expect.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 17:09:24 -07:00
gsxdsm
856146cced chore(pi-claude-cli): log system-prompt tool-name rewrite for diagnostics
Adds stderr lines so we can verify the rewrite is actually firing on a given
session ("rewrote N custom tool ref(s) [fn_review_spec×3, ...]") vs. silently
no-opping (no tools, no matches). Helps distinguish "fix not deployed yet"
from "fix not effective" without redeploying instrumentation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 17:01:53 -07:00
gsxdsm
5e0004cca2 fix(pi-claude-cli): rewrite bare custom tool refs in system prompt to MCP names
Triage system prompts read "MUST call fn_review_spec()" but Sonnet 4.6 routed
through pi-claude-cli writes PROMPT.md and silently skips the call — even with
the addendum explaining the deferred-tool protocol. Confirmed by the FN-2564
agent log: model called other MCP tools (fn_memory_search, fn_task_list) fine
but consistently never reached fn_review_spec, leaving triage looping on
"fn_review_spec was never called" and falling back to zai/glm-5.1 every time.

Rewrite bare `fn_*` (and any non-built-in custom tool name) references in the
system prompt to their `mcp__custom-tools__fn_*` form before sending. The
prompt now literally says "call mcp__custom-tools__fn_review_spec()" so the
model has no inference step, and the deferred-tool reminder Claude Code injects
matches verbatim. Word-boundary safe (won't touch fn_review_specifier) and
idempotent (won't double-prefix already-MCP-named occurrences).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 16:50:33 -07:00
gsxdsm
ad416b5581 fix(pi-claude-cli): teach Claude to call deferred MCP tools by their prefixed names
Claude Code 2.x defers MCP tool schemas behind ToolSearch — tools are listed
but calling them by short name (e.g. fn_review_spec) returns "tool not found"
until ToolSearch loads the schema. Triage system prompts that say "call
fn_review_spec()" leave the model guessing whether to use the bare name or
the mcp__custom-tools__ form.

Append a system-prompt section listing every custom tool with its short and
MCP-prefixed names plus the ToolSearch + call protocol. Drives off the
Context.tools we now already thread through, so plain chats with no custom
tools get no addendum.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 16:23:24 -07:00
gsxdsm
1872abc1d0 fix(pi-claude-cli): source MCP tool list from session Context, not pi.getAllTools
The previous fix regenerated the MCP config per call but still pulled the tool
set from pi.getAllTools(), which depends on the runtime binding being scoped to
the right AgentSession. Engine-spawned triage/executor sessions register custom
tools (fn_review_spec, fn_review_step) and pi-ai already passes those to the
provider via Context.tools — that's the authoritative per-session list and
bypasses any binding ambiguity. Falls back to pi.getAllTools() when the caller
doesn't populate Context.tools.

Also logs the tool names on refresh so missing tools are diagnosable from stderr.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 14:31:15 -07:00
gsxdsm
e8aab69c67 fix: regenerate pi-claude-cli MCP config per session and auto-sync skill tools
The MCP config was generated lazily once and locked, so engine session-scoped
tools (fn_review_spec, fn_review_step) never reached the Claude CLI subprocess
and triage/executor sessions failed with "unknown tool" errors. Now the config
is hashed per call and rewritten when the tool set changes.

Also adds scripts/sync-fusion-skill-tools.mjs to regenerate the SKILL.md
tool-categories block from extension.ts at build time, with a --check mode
wired into skill-sync tests so drift fails CI.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 14:10:56 -07:00
gsxdsm
7f5ffc5920 chore(release): v0.2.7
Version bump via changesets.
2026-04-25 11:38:48 -07:00