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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: speed up brain inbox classification with gemini-cli
Adam Eivy9dbd437659c0
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex ec29b3024c..b8aded27d9 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -7,3 +7,4 @@- **POST drill scoring paired every answer to the first prompt** — `llmResponseSchema` in `postValidation.js` didn't list `questionIndex`, so Zod's default strip mode dropped the field on its way to the scorer. The scorer's `r.questionIndex ?? i` fallback then resolved to the response-array index — always 0 for the single-response submits the trainer makes — and every answer was evaluated against the FIRST prompt of the drill. Affected bridge-word, idiom-twist, double-meaning, and every other LLM-scored POST drill (the v1.43.0 client-side fix wired up `questionIndex` on the request but it never reached the scorer). Schema now declares `questionIndex` and a regression test in `postValidation.test.js` covers the round-trip.- **Compound chain rejected the natural shorthand** — typing just the *other half* of a compound (e.g., `hose`, `pit`, `work` for the root `fire`) was scored as invalid because the local scorer required the user's input to literally include the root word. Players had to type `firehose` / `firepit` / `firework` in full, which slowed them down and produced misleading "0 valid compounds" scores. Scorer now accepts both the full compound and the half — bare root word still rejected, and the "you could also have said" suggestions correctly suppress examples the user already covered via either form. UI placeholder updated to "Type the full compound or just the other half...".+- **Brain inbox classification with Gemini CLI was slow** — the provider had no default model, so `gemini` fell back to `gemini-2.5-pro` (a thinking model) and was also invoked without `--prompt`, forcing interactive-mode detection on every classify call. `brain.js callAI()` now sends gemini-cli prompts via `--prompt`, passes `--output-format text`, and defaults to `gemini-2.5-flash-lite` (thinking disabled) when no model is set. Sample providers config populates `models`/`defaultModel`/`lightModel`/`mediumModel`/`heavyModel` for gemini-cli so new installs pick up the fast model automatically.diff --git a/data.sample/providers.json b/data.sample/providers.jsonindex 024c258662..b4173fcd66 100644--- a/data.sample/providers.json+++ b/data.sample/providers.json@@ -55,8 +55,11 @@"type": "cli","command": "gemini","args": [],- "models": [],- "defaultModel": null,+ "models": ["gemini-2.5-flash-lite", "gemini-2.5-flash", "gemini-2.5-pro"],+ "defaultModel": "gemini-2.5-flash-lite",+ "lightModel": "gemini-2.5-flash-lite",+ "mediumModel": "gemini-2.5-flash",+ "heavyModel": "gemini-2.5-pro","timeout": 300000,"enabled": true,"envVars": {}diff --git a/server/services/brain.js b/server/services/brain.jsindex 26d7aaeb9d..4392b2ecab 100644--- a/server/services/brain.js+++ b/server/services/brain.js@@ -48,7 +48,12 @@ async function callAI(promptStageName, variables, providerOverride, modelOverrid}const prompt = await buildPrompt(promptStageName, variables);- const model = modelOverride || provider.defaultModel;+ let model = modelOverride || provider.defaultModel;++ // gemini-cli default is a thinking model (2.5-pro); fall back to flash-lite for speed+ if (provider.id === 'gemini-cli' && !model) {+ model = 'gemini-2.5-flash-lite';+ }console.log(`🧠 Calling AI: ${provider.id} / ${model} / ${promptStageName}`);@@ -59,10 +64,19 @@ async function callAI(promptStageName, variables, providerOverride, modelOverridif (provider.headlessArgs?.length) {args.push(...provider.headlessArgs);}+ // gemini-cli goes interactive unless --prompt is set, hanging on /dev/null stdin+ const isGeminiCli = provider.id === 'gemini-cli';+ if (isGeminiCli && !args.includes('--output-format') && !args.includes('-o')) {+ args.push('--output-format', 'text');+ }if (model) {args.push('--model', model);}- args.push(prompt);+ if (isGeminiCli) {+ args.push('--prompt', prompt);+ } else {+ args.push(prompt);+ }let output = '';const child = spawn(provider.command, args, {