From 2be6040b02258961db9f95ff2d5b8a6bfa97746c Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Thu, 9 Jul 2026 22:19:22 -0700 Subject: [PATCH] FN-7758: route Grok CLI fallback models through the CLI runtime when no API key is visible Fix Grok CLI 'missing API key' false-positive by extending the no-visible-key routing invariant to configured fallback models, not just the default provider. - deriveGrokRuntimeHintForNoVisibleKey now also triggers when the fallback provider is grok-cli - new applyGrokCliNoKeyRuntimeOptions promotes a grok-cli fallback model into the primary session (stripping the provider-qualified model prefix) instead of leaving it as an unused fallback - docs/grok-cli-contract.md updated to describe the fallback-routing contract - added regression tests in grok-runtime-routing.test.ts, chat-manager.test.ts, and chat-manager-room-hybrid.test.ts - added changeset fn-7758-grok-cli-no-key-routing.md (patch) Files changed: .changeset/fn-7758-grok-cli-no-key-routing.md | 7 ++ docs/grok-cli-contract.md | 29 +++-- .../src/__tests__/chat-manager-room-hybrid.test.ts | 36 +++++++ .../dashboard/src/__tests__/chat-manager.test.ts | 41 +++++++ packages/dashboard/src/chat.ts | 16 ++- .../src/__tests__/grok-runtime-routing.test.ts | 118 +++++++++++++++++++++ packages/engine/src/agent-session-helpers.ts | 36 ++++++- 7 files changed, 266 insertions(+), 17 deletions(-) Fusion-Task-Id: FN-7758 Fusion-Task-Lineage: 6b564b21-50ab-4c3e-b0d7-7fded2091d90 Co-authored-by: Fusion (runfusion.ai) --- .changeset/fn-7758-grok-cli-no-key-routing.md | 7 ++ docs/grok-cli-contract.md | 29 +++-- .../chat-manager-room-hybrid.test.ts | 36 ++++++ .../src/__tests__/chat-manager.test.ts | 41 ++++++ packages/dashboard/src/chat.ts | 16 ++- .../__tests__/grok-runtime-routing.test.ts | 118 ++++++++++++++++++ packages/engine/src/agent-session-helpers.ts | 36 +++++- 7 files changed, 266 insertions(+), 17 deletions(-) create mode 100644 .changeset/fn-7758-grok-cli-no-key-routing.md diff --git a/.changeset/fn-7758-grok-cli-no-key-routing.md b/.changeset/fn-7758-grok-cli-no-key-routing.md new file mode 100644 index 0000000000..8e62aaa17e --- /dev/null +++ b/.changeset/fn-7758-grok-cli-no-key-routing.md @@ -0,0 +1,7 @@ +--- +"@runfusion/fusion": patch +--- + +summary: Route no-key Grok CLI chat and fallback model selections through the bundled CLI runtime. +category: fix +dev: Extends grok-cli no-visible-key routing to dashboard chat defaults, room responders, and fallback models. diff --git a/docs/grok-cli-contract.md b/docs/grok-cli-contract.md index fff3a188a7..a8083a46e9 100644 --- a/docs/grok-cli-contract.md +++ b/docs/grok-cli-contract.md @@ -134,7 +134,7 @@ Notes: `GrokCliProviderCard.tsx`) is out of scope for this task and is not modified here. -## Wiring (resolved — FN-7725, extended by FN-7753) +## Wiring (resolved — FN-7725, extended by FN-7753/FN-7758)