From 5696d4497ff8af040ba3b96b075ee85047880131 Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Mon, 15 Jun 2026 12:34:44 -0700 Subject: [PATCH] fix(review): address PR #1681 feedback (acp.active accuracy + FNXC comments) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Greptile P2: `acp.active` now reflects the ACTUAL dispatch determinant (FUSION_CLAUDE_ACP, which includes the operator force-override), not the experimental flag alone — so the status isn't misleading when forced on/off. - CodeRabbit/Greptile P2: add FNXC:ClaudeAcp comments to the new code blocks per the AGENTS.md greppable-comment convention. Already fixed in the prior commit (daa37d08c): the P1 "sticky env" / latch (applyClaudeAcpEnable now recomputes each call + FUSION_CLAUDE_ACP_FORCE override) and the enable->disable-on-same-env regression test. Co-Authored-By: Claude Opus 4.8 --- packages/dashboard/src/routes/register-auth-routes.ts | 8 +++++++- packages/engine/src/claude-acp-enable.ts | 1 + packages/pi-claude-cli/src/acp-driver.ts | 1 + plugins/fusion-plugin-acp-runtime/src/index.ts | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/dashboard/src/routes/register-auth-routes.ts b/packages/dashboard/src/routes/register-auth-routes.ts index c2927774b8..7b886835e1 100644 --- a/packages/dashboard/src/routes/register-auth-routes.ts +++ b/packages/dashboard/src/routes/register-auth-routes.ts @@ -603,6 +603,12 @@ export const registerAuthRoutes: ApiRouteRegistrar = (ctx) => { const acpBridgeAvailable = typeof process.env.FUSION_CLAUDE_ACP_BRIDGE === "string" && process.env.FUSION_CLAUDE_ACP_BRIDGE.length > 0; + // FNXC:ClaudeAcp 2026-06-15-11:40: + // `active` must reflect the ACTUAL dispatch determinant — FUSION_CLAUDE_ACP + // (set by applyClaudeAcpEnable from the flag OR the operator force-override), + // not the flag alone — so the status isn't misleading when an operator forces + // it on/off. + const acpEnvOn = process.env.FUSION_CLAUDE_ACP === "1"; // R17: the driver writes this signal when a turn comes back "Not logged in" // (the bridged `claude` can't authenticate). Surface it so the UI can offer // fall-back-to-`-p` or fix-auth. Path matches ACP_BRIDGE_AUTH_SIGNAL_PATH. @@ -628,7 +634,7 @@ export const registerAuthRoutes: ApiRouteRegistrar = (ctx) => { acp: { enabled: acpEnabled, bridgeAvailable: acpBridgeAvailable, - active: enabled && acpEnabled && acpBridgeAvailable, + active: enabled && acpBridgeAvailable && acpEnvOn, authFailed: acpAuthFailed, authReason: acpAuthReason, }, diff --git a/packages/engine/src/claude-acp-enable.ts b/packages/engine/src/claude-acp-enable.ts index e02fb7ab86..884028197b 100644 --- a/packages/engine/src/claude-acp-enable.ts +++ b/packages/engine/src/claude-acp-enable.ts @@ -1,4 +1,5 @@ /** + * FNXC:ClaudeAcp 2026-06-15-11:40: * Route A enable resolution (experimental, DEFAULT ON). * * The `pi-claude-cli` provider drives Claude through the `claude-code-cli-acp` diff --git a/packages/pi-claude-cli/src/acp-driver.ts b/packages/pi-claude-cli/src/acp-driver.ts index 7b8b9a929d..2e1fe14cc8 100644 --- a/packages/pi-claude-cli/src/acp-driver.ts +++ b/packages/pi-claude-cli/src/acp-driver.ts @@ -79,6 +79,7 @@ const MAX_TURN_CHARS = 5_000_000; const MAX_ID_CHARS = 256; /** + * FNXC:ClaudeAcp 2026-06-15-11:40: * Cross-process signal for the dashboard: when the bridged `claude` can't * authenticate (R17 — e.g. a detached daemon with no keychain), the turn comes * back as "Not logged in · Please run /login" instead of a real answer. We diff --git a/plugins/fusion-plugin-acp-runtime/src/index.ts b/plugins/fusion-plugin-acp-runtime/src/index.ts index c998af80ea..e79ff8a5f5 100644 --- a/plugins/fusion-plugin-acp-runtime/src/index.ts +++ b/plugins/fusion-plugin-acp-runtime/src/index.ts @@ -49,6 +49,7 @@ const plugin: FusionPlugin = definePlugin({ "will be auto-approved under an allow-all policy. Prefer an approval-required policy.", ); } + // FNXC:ClaudeAcp 2026-06-15-11:40: // KTD10 (Route A): publish the bundled `claude-code-cli-acp` bridge path // process-wide so the pi-claude-cli provider's kill-switch can resolve it // WITHOUT a manual FUSION_CLAUDE_ACP_BRIDGE env var. This only PUBLISHES the