Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

warn before enabling the Grok Build CLI/TUI that it uploads the whole repo to xAI

[._.]/ Adam Eivycedd4d4d59bd
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index e1d44e2b71..af6fae6ff4 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -13,4 +13,5 @@
## Fixed
+- **AI Providers warns before enabling the Grok Build CLI/TUI.** The Grok harness uploads your entire working repo to xAI (GCP) as it works. The provider card now shows a callout on the `grok-cli` / `grok-tui` providers (and any process provider whose command is `grok`) telling you to add `[harness]` / `disable_codebase_upload = true` to `~/.grok/config.toml` to keep your code local. The plain `grok` API provider — which doesn't run the harness — is intentionally excluded.
- **Layered Intelligence no longer wedges on a stale API-only provider.** Any install that ran the Layered Intelligence loop on an api provider (ollama/lmstudio/kimi) before it became agent-backed (#2322) had that provider carried into the per-app override by migration 184 — where it now outranks the global Schedule pin at spawn. The agent-backed loop needs a file-writing CLI/TUI harness, so those runs skipped with "the selected provider is an API-only model with no coding harness," and picking a CLI/TUI provider on the global Schedule page silently missed (it only sets the fallback pin). The loop now self-heals: an api-only per-app provider falls back to a CLI/TUI schedule pin (adopting its matched model), so the Schedule-page selection finally takes effect. It still skips with the actionable message only when no CLI/TUI provider is configured anywhere.
diff --git a/client/src/pages/AIProviders.jsx b/client/src/pages/AIProviders.jsx
index 498d546329..abcbba8b2d 100644
--- a/client/src/pages/AIProviders.jsx
+++ b/client/src/pages/AIProviders.jsx
@@ -2,7 +2,7 @@ import { useState, useEffect, useCallback } from 'react';
import toast from '../components/ui/Toast';
import * as api from '../services/api';
import socket from '../services/socket';
-import { filterSelectableModels, filterGenerationModels, isEmbeddingModel, mergeModelLists, localBackendForProvider, modelOptionLabel, providerTypeClass, isTuiProvider, isApiProvider, isProcessProvider, isOllamaBackedProvider, isClaudeCodePlanCli, effectiveModelContextWindow } from '../utils/providers';
+import { filterSelectableModels, filterGenerationModels, isEmbeddingModel, mergeModelLists, localBackendForProvider, modelOptionLabel, providerTypeClass, isTuiProvider, isApiProvider, isProcessProvider, isOllamaBackedProvider, isClaudeCodePlanCli, isGrokBuildCli, effectiveModelContextWindow } from '../utils/providers';
import useLocalModels from '../hooks/useLocalModels';
import EmptyState from '../components/EmptyState';
import {
@@ -567,6 +567,16 @@ export default function AIProviders() {
</div>
)}
+ {isGrokBuildCli(provider) && (
+ <div className="mt-2 text-xs rounded-md border border-port-warning/40 bg-port-warning/10 text-port-warning px-2.5 py-2 leading-relaxed">
+ ⚠️ The Grok harness uploads your <span className="font-semibold">entire working repo</span> to
+ xAI (GCP) as it works. To keep your code local, add the following to{' '}
+ <code className="font-mono">~/.grok/config.toml</code> before enabling this provider:
+ <pre className="mt-1.5 whitespace-pre rounded bg-port-bg/60 px-2 py-1.5 font-mono text-[11px] text-port-warning">{`[harness]
+disable_codebase_upload = true`}</pre>
+ </div>
+ )}
+
{testResults[provider.id] && !testResults[provider.id].testing && (
<div className={`mt-2 text-sm ${testResults[provider.id].success ? 'text-port-success' : 'text-port-error'}`}>
{testResults[provider.id].success
diff --git a/client/src/utils/providers.js b/client/src/utils/providers.js
index 6c55c16698..f279c40084 100644
--- a/client/src/utils/providers.js
+++ b/client/src/utils/providers.js
@@ -319,6 +319,21 @@ export const isClaudeCodePlanCli = (provider) =>
!provider?.envVars?.CLAUDE_CODE_USE_BEDROCK &&
!provider?.envVars?.CLAUDE_CODE_USE_VERTEX;
+/**
+ * Check if a provider is the Grok Build CLI/TUI (the `grok` command harness).
+ * Mirrors the Grok detection in `knownProviderContextWindow`: matches the shipped
+ * `grok-cli` / `grok-tui` samples or any process provider whose command basename
+ * is `grok`. Used to surface the `~/.grok/config.toml` privacy notice: the Grok
+ * harness uploads the entire working repo to xAI/GCP as it works unless the user
+ * opts out via `[harness] disable_codebase_upload = true`. The plain `grok` API
+ * provider (type `api`) doesn't run the harness, so it's intentionally excluded.
+ */
+export const isGrokBuildCli = (provider) => {
+ if (!isProcessProvider(provider)) return false;
+ const id = String(provider?.id || '').toLowerCase();
+ return id === 'grok-cli' || id === 'grok-tui' || commandBasename(provider?.command) === 'grok';
+};
+
/**
* Resolve the provider whose timeout is the "fallback" for a stage — the
* stage's pinned provider when set, otherwise the active provider. Used to
diff --git a/client/src/utils/providers.test.js b/client/src/utils/providers.test.js
index 8e6e6d6376..95629b80a0 100644
--- a/client/src/utils/providers.test.js
+++ b/client/src/utils/providers.test.js
@@ -29,6 +29,7 @@ import {
isProcessProvider,
isOllamaBackedProvider,
isClaudeCodePlanCli,
+ isGrokBuildCli,
enabledApiProviderFilter,
providerTypeClass,
getProviderTimeout,
@@ -160,6 +161,30 @@ describe('isClaudeCodePlanCli', () => {
});
});
+describe('isGrokBuildCli', () => {
+ it('matches the shipped grok-cli / grok-tui samples', () => {
+ expect(isGrokBuildCli({ id: 'grok-cli', type: 'cli', command: 'grok' })).toBe(true);
+ expect(isGrokBuildCli({ id: 'grok-tui', type: 'tui', command: 'grok' })).toBe(true);
+ });
+
+ it('matches any process provider whose command basename is grok', () => {
+ expect(isGrokBuildCli({ id: 'custom', type: 'cli', command: '/opt/homebrew/bin/grok' })).toBe(true);
+ });
+
+ it('does not match the plain grok API provider (no harness upload)', () => {
+ expect(isGrokBuildCli({ id: 'grok', type: 'api', command: '' })).toBe(false);
+ });
+
+ it('does not match non-grok process providers', () => {
+ expect(isGrokBuildCli({ id: 'codex', type: 'cli', command: 'codex' })).toBe(false);
+ });
+
+ it('safely returns false for nullish input', () => {
+ expect(isGrokBuildCli(null)).toBe(false);
+ expect(isGrokBuildCli(undefined)).toBe(false);
+ });
+});
+
describe('enabledApiProviderFilter', () => {
it('keeps only enabled api providers', () => {
const list = [