From 335dfc3bec3d8e37cdd3166c18c37ae76bc2c183 Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Thu, 9 Jul 2026 00:26:01 -0700 Subject: [PATCH] FN-7715: clarify GrokRuntimeAdapter no-op stub with intent documentation Documents that GrokRuntimeAdapter.promptWithFallback is an intentional no-op rather than unfinished work, and updates its regression test to assert that contract explicitly. - Add FNXC:GrokCli comment on promptWithFallback explaining Grok streaming already flows through the pi/xAI OpenAI-compatible path from FN-7711, that the grok CLI has no documented non-interactive prompt/stream subcommand, and that this stub is only reached via an unused runtimeConfig.runtimeHint === "grok" path - Remove the stale TODO(FN-7705) comment - Rename/expand the promptWithFallback test to assert the intentional no-op contract (resolves without throwing, returns undefined) Files changed: .../src/__tests__/runtime-adapter.test.ts | 11 ++++++++++- .../fusion-plugin-grok-runtime/src/runtime-adapter.ts | 18 ++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) Fusion-Task-Id: FN-7715 Fusion-Task-Lineage: 118639d3-5530-45d5-bc66-de9b1f18fbc4 Co-authored-by: Fusion (runfusion.ai) --- .../src/__tests__/runtime-adapter.test.ts | 11 ++++++++++- .../src/runtime-adapter.ts | 18 ++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/plugins/fusion-plugin-grok-runtime/src/__tests__/runtime-adapter.test.ts b/plugins/fusion-plugin-grok-runtime/src/__tests__/runtime-adapter.test.ts index e6f12b4c9e..d5e063b1f5 100644 --- a/plugins/fusion-plugin-grok-runtime/src/__tests__/runtime-adapter.test.ts +++ b/plugins/fusion-plugin-grok-runtime/src/__tests__/runtime-adapter.test.ts @@ -9,8 +9,17 @@ describe("GrokRuntimeAdapter", () => { expect(result.session.systemPrompt).toBe("sys"); }); - it("promptWithFallback resolves without throwing", async () => { + // FN-7715: promptWithFallback is an INTENTIONAL no-op — Grok streaming + // flows through the pi/xAI OpenAI-compatible path registered by FN-7711, + // not through this plugin runtime adapter (which is only reached via + // runtimeConfig.runtimeHint === "grok", which nothing in the product + // sets). This module imports no process-spawning seam (compare + // process-manager.ts's `runGrokCommand`), so this asserts the intentional + // no-op contract at the only observable boundary: it resolves without + // throwing and returns no value, taking no action. + it("promptWithFallback is an intentional no-op: resolves without throwing, returns undefined", async () => { const adapter = new GrokRuntimeAdapter(); + await expect(adapter.promptWithFallback()).resolves.toBeUndefined(); }); diff --git a/plugins/fusion-plugin-grok-runtime/src/runtime-adapter.ts b/plugins/fusion-plugin-grok-runtime/src/runtime-adapter.ts index 0033a41edc..1bc56e7fe6 100644 --- a/plugins/fusion-plugin-grok-runtime/src/runtime-adapter.ts +++ b/plugins/fusion-plugin-grok-runtime/src/runtime-adapter.ts @@ -13,9 +13,23 @@ export class GrokRuntimeAdapter { }; } + /* + FNXC:GrokCli 2026-07-09-00:00: + FN-7715: this is an INTENTIONAL no-op, not unfinished work. FN-7711 already + routes `grok-cli/*` model selections through the standard pi/openai-completions + streaming path against https://api.x.ai/v1 — that is the real, exercised Grok + streaming path. The `grok` binary (see provider.ts / process-manager.ts) is + wired for discovery/probe only (`grok models`, `grok --version`); there is no + documented non-interactive prompt/stream subcommand to invoke here, and + inventing one would violate the external-integration-evidence policy. This + adapter's `promptWithFallback` is only reached when an agent's + `runtimeConfig.runtimeHint === "grok"`, which nothing in the product sets + today. Mirrors the identical intentional stub in the sibling Cursor plugin + (`fusion-plugin-cursor-runtime/src/runtime-adapter.ts`, TODO(FN-3396)). If a + stable non-interactive `grok` CLI streaming contract is confirmed upstream in + the future, a follow-up task can revisit this. + */ async promptWithFallback(): Promise { - // TODO(FN-7705): Implement Grok CLI prompt streaming once a stable - // invocation contract beyond probe/discovery commands is confirmed. return; }