Server-key fallback: AI_API_KEY/AI_MODEL/AI_BASE_URL on the app container, plan-gated by entitlements.AllowServerAI — the core plan (which TIER=core derives) is included and its AIMode is core ("house Core AI settings"). So a core install whose operator supplies the house key in the app .env already gets "use the Core AI" with zero per-user setup; GET /api/ai/status then reports effective: server, and the UI shows it as the source.
New since the last comment: Settings → API Keys + the superbrain-mcp MCP server (mcp/) let the house AI agents on core (Hermes / mcphub via the mcpserver gateway) reach Superbrain data; gated on the mcp-core connector, core plan only. config_mcpserver_superbrain() in deploy/federated/lib-superbrain.sh mints the gateway's key.
Still missing is exactly the open question from my last comment: where Superpanel stores the per-core AI configuration and how it is provisioned into the app's .env (or exposed as an API Superbrain should call). Keeping this open until that contract is defined; the fallback path above means the feature degrades gracefully to BYO until then.
Status note while we wait for Derek's Superpanel walkthrough (Monday):
What already exists on the Superbrain side:
- Per-user BYO config (Settings → AI, `1.1.1`) resolves first.
- Server-key fallback: `AI_API_KEY`/`AI_MODEL`/`AI_BASE_URL` on the app container, plan-gated by `entitlements.AllowServerAI` — the **core** plan (which `TIER=core` derives) is included and its `AIMode` is `core` ("house Core AI settings"). So a core install whose operator supplies the house key in the app `.env` already gets "use the Core AI" with zero per-user setup; `GET /api/ai/status` then reports `effective: server`, and the UI shows it as the source.
- New since the last comment: Settings → API Keys + the `superbrain-mcp` MCP server (`mcp/`) let the house AI agents on core (Hermes / `mcphub` via the `mcpserver` gateway) reach Superbrain data; gated on the `mcp-core` connector, core plan only. `config_mcpserver_superbrain()` in `deploy/federated/lib-superbrain.sh` mints the gateway's key.
Still missing is exactly the open question from my last comment: where Superpanel stores the per-core AI configuration and how it is provisioned into the app's `.env` (or exposed as an API Superbrain should call). Keeping this open until that contract is defined; the fallback path above means the feature degrades gracefully to BYO until then.
Half resolved — the in-app AI half. Core's .env carried the house OpenRouter key but pointed AI_MODEL at recursive/flint-v1.0:free, which OpenRouter now answers 503 "no upstreams available", so the server-key path was silently dead. Model switched to a live free slug and the app recreated: SSO users on core now get effective: server in /api/ai/status with zero per-user setup. This is operator-env provisioning; the automatic half (Superpanel pushing its core-AI config into Superbrain) still waits on the storage contract from Derek's walkthrough.
The other half is the MCP attach — per the framing in this thread, "use the Core AI" for Superbrain means what every other suite app gets: the house AI (Superpanel-configured LLM behind Hermes) reaches Superbrain data through the mcpserver gateway, with no LLM config inside Superbrain at all. That work is tracked in the dedicated MCP issue (see below); everything Superbrain-side for it shipped in 1.2.0/1.2.1.
Keeping this issue open for: (a) the Superpanel auto-provisioning contract, and (b) confirmation that the MCP attach satisfies the original ask.
Status update (post-1.2.1):
**Half resolved — the in-app AI half.** Core's `.env` carried the house OpenRouter key but pointed `AI_MODEL` at `recursive/flint-v1.0:free`, which OpenRouter now answers 503 "no upstreams available", so the server-key path was silently dead. Model switched to a live free slug and the app recreated: SSO users on core now get `effective: server` in `/api/ai/status` with zero per-user setup. This is operator-env provisioning; the *automatic* half (Superpanel pushing its core-AI config into Superbrain) still waits on the storage contract from Derek's walkthrough.
**The other half is the MCP attach** — per the framing in this thread, "use the Core AI" for Superbrain means what every other suite app gets: the house AI (Superpanel-configured LLM behind Hermes) reaches Superbrain *data* through the mcpserver gateway, with no LLM config inside Superbrain at all. That work is tracked in the dedicated MCP issue (see below); everything Superbrain-side for it shipped in 1.2.0/1.2.1.
Keeping this issue open for: (a) the Superpanel auto-provisioning contract, and (b) confirmation that the MCP attach satisfies the original ask.
Cross-reference correction: the dedicated MCP-attach tracker is #11 ("Can connect to Federated Core agent for various MCP actions available in Core"); the interim #17 I opened today was closed as its duplicate. The checklist in #11 is the resolution path for the MCP half of this issue.
Cross-reference correction: the dedicated MCP-attach tracker is **#11** ("Can connect to Federated Core agent for various MCP actions available in Core"); the interim #17 I opened today was closed as its duplicate. The checklist in #11 is the resolution path for the MCP half of this issue.
How AI in Superbrain works — canonical explainer (supersedes my earlier status notes in this thread; code references are to tag 1.2.3).
1. Two config sources, resolved per request in this order (internal/ai):
Per-user BYO — Settings → AI (UserAiConfig row): provider (openai-compatible / anthropic / gemini), base URL, model, API key (encrypted at rest, masked in every response, write-only), optional custom instructions, enabled flag. Wins when present and enabled.
Server / house key — AI_API_KEY (+ optional AI_MODEL, AI_BASE_URL, AI_PROVIDER; sane per-provider defaults, incl. a code DefaultModel) in the app container's env. Plan-gated: entitlements.AllowServerAI permits premium/core/selfhosted; free and standard are BYO-only. A core install (TIER=core → plan core, AIMode "core") is precisely the "house Core AI" case this issue asks for.
Neither → HTTP 428 pointing at Settings → AI. Never a silent failure. GET /api/ai/status returns {userConfigured, userEnabled, serverAvailable, effective: user|server|none, plan} so the UI states availability without guessing entitlements.
2. What consumes the resolved config:
In-app assistant (POST /api/ai/chat): ephemeral multi-turn; server-owned persona; the user's instructions ride along as a delimited section; may propose automations (same schema as the compiler); history lives in the browser.
Automation compiler (POST /api/agent/compile) and assistant proposals: natural language → Spec; the validator, not the model, decides what a proposal is; closed action set (notify / email / bookmark); fire caps (5 emails per task, 20 per owner per day); 15-minute poll floor; fetched page content is untrusted, delimited data — the model never chooses actions or gains an instruction path.
Automation engine runs: url_watch fetches through netguard and the LLM extracts against the stored question; mailbox-signal triggers need no AI.
POST /api/ai/test: one-token probe so misconfiguration fails loudly in Settings, not mid-task.
3. What does NOT use this config: the MCP attach (#11). There, the house agent (Hermes, running whatever LLM Superpanel configures) reaches Superbrain data through superbrain-mcp — no in-app LLM involved. That is the "every app has an MCP attached" path and needs zero AI config inside Superbrain.
4. Operational state (2026-11-03):
Dev stack: verified end-to-end — effective: server, test probe pong, assistant answers, compile → validated spec, task run fired and the agent created a bookmark in the workspace.
Core: the house OpenRouter key was already in the app .env, but AI_MODEL pointed at recursive/flint-v1.0:free, which OpenRouter now answers 503 "no upstreams available" — switched to a live free slug and the app recreated, so SSO users get effective: server even on 1.0.1. The 1.2.x upgrade (API keys, MCP, toolbar, light mode) awaits image publication (DockerHub secrets).
The code DefaultModel was the same dead slug; fixed in 1.2.3 so AI_API_KEY-only deployments don't inherit a dead default.
5. What this issue still asks for:automatic provisioning of source 2 from Superpanel ("if it is configured in Superpanel"). The contract — where Superpanel keeps the core-AI config (per the UI caption: the Hermes environment file) and how it reaches Superbrain's env — is the open unknown from Derek's walkthrough. Until then, operator env provisioning is the mechanism and this issue stays open for that contract, plus a decision on whether the MCP attach (#11) satisfies the original ask.
6. Ops caveat: OpenRouter free slugs rotate (flint died between 1.2.0 and today). If a model 503s, swapping AI_MODEL is a one-line env change + app recreate — no rebuild, no release.
**How AI in Superbrain works — canonical explainer** (supersedes my earlier status notes in this thread; code references are to tag 1.2.3).
**1. Two config sources, resolved per request in this order (`internal/ai`):**
1. **Per-user BYO** — Settings → AI (`UserAiConfig` row): provider (openai-compatible / anthropic / gemini), base URL, model, API key (encrypted at rest, masked in every response, write-only), optional custom instructions, enabled flag. Wins when present and enabled.
2. **Server / house key** — `AI_API_KEY` (+ optional `AI_MODEL`, `AI_BASE_URL`, `AI_PROVIDER`; sane per-provider defaults, incl. a code `DefaultModel`) in the app container's env. Plan-gated: `entitlements.AllowServerAI` permits premium/core/selfhosted; free and standard are BYO-only. A core install (`TIER=core` → plan `core`, `AIMode` "core") is precisely the "house Core AI" case this issue asks for.
3. **Neither** → HTTP 428 pointing at Settings → AI. Never a silent failure.
`GET /api/ai/status` returns `{userConfigured, userEnabled, serverAvailable, effective: user|server|none, plan}` so the UI states availability without guessing entitlements.
**2. What consumes the resolved config:**
- **In-app assistant** (`POST /api/ai/chat`): ephemeral multi-turn; server-owned persona; the user's instructions ride along as a delimited section; may propose automations (same schema as the compiler); history lives in the browser.
- **Automation compiler** (`POST /api/agent/compile`) and assistant proposals: natural language → `Spec`; the **validator, not the model**, decides what a proposal is; closed action set (notify / email / bookmark); fire caps (5 emails per task, 20 per owner per day); 15-minute poll floor; fetched page content is untrusted, delimited data — the model never chooses actions or gains an instruction path.
- **Automation engine runs**: `url_watch` fetches through netguard and the LLM extracts against the stored question; mailbox-signal triggers need no AI.
- `POST /api/ai/test`: one-token probe so misconfiguration fails loudly in Settings, not mid-task.
**3. What does NOT use this config:** the MCP attach (#11). There, the house agent (Hermes, running whatever LLM Superpanel configures) reaches Superbrain *data* through `superbrain-mcp` — no in-app LLM involved. That is the "every app has an MCP attached" path and needs zero AI config inside Superbrain.
**4. Operational state (2026-11-03):**
- Dev stack: verified end-to-end — `effective: server`, test probe pong, assistant answers, compile → validated spec, task run **fired** and the agent created a bookmark in the workspace.
- Core: the house OpenRouter key was already in the app `.env`, but `AI_MODEL` pointed at `recursive/flint-v1.0:free`, which OpenRouter now answers 503 "no upstreams available" — switched to a live free slug and the app recreated, so SSO users get `effective: server` even on 1.0.1. The 1.2.x upgrade (API keys, MCP, toolbar, light mode) awaits image publication (DockerHub secrets).
- The code `DefaultModel` was the same dead slug; fixed in 1.2.3 so `AI_API_KEY`-only deployments don't inherit a dead default.
**5. What this issue still asks for:** *automatic* provisioning of source 2 from Superpanel ("if it is configured in Superpanel"). The contract — where Superpanel keeps the core-AI config (per the UI caption: the Hermes environment file) and how it reaches Superbrain's env — is the open unknown from Derek's walkthrough. Until then, operator env provisioning is the mechanism and this issue stays open for that contract, plus a decision on whether the MCP attach (#11) satisfies the original ask.
**6. Ops caveat:** OpenRouter free slugs rotate (flint died between 1.2.0 and today). If a model 503s, swapping `AI_MODEL` is a one-line env change + app recreate — no rebuild, no release.
MCP half of this issue is now live on the erwin core: the house AI gateway (mcphub) exposes all 14 superbrain tools — see the closure note on #11 for evidence and the interim gateway image. Remaining here: the Superpanel auto-provisioning contract for the in-app AI half (server-key slot already working on core).
MCP half of this issue is now live on the erwin core: the house AI gateway (mcphub) exposes all 14 superbrain tools — see the closure note on #11 for evidence and the interim gateway image. Remaining here: the Superpanel auto-provisioning contract for the in-app AI half (server-key slot already working on core).
Checked 2026-11-09 on the erwin core (1.2.6), per the original ask ("if a Core has AI configured for the Core, use that"):
The mechanism works as designed and is verified live: with the house key in the app env, /api/ai/status (via a throwaway API key, revoked after) reports {"effective":"server","plan":"core","serverAvailable":true} and /api/ai/test returns pong — i.e. every core user gets the core's AI with zero per-user config, and a per-user BYO row would still take precedence.
Two findings while checking:
Model slugs can rot per egress route.nvidia/nemotron-3-ultra-550b-a55b:free answered 200 from the dev host but hung at connect level from erwin (so /api/ai/test died with an empty reply at Go's 60s WriteTimeout); google/gemma-4-31b-it:free 429s instantly from erwin. Core's AI_MODEL is now nvidia/nemotron-3.5-lightning:free, probed 200 from the core itself and re-verified end-to-end. Rule going forward: probe candidate models FROM the core host before pinning.
The Superpanel-side store still does not exist on erwin — no AI rows in superpanel's app_config, Hermes not installed, no provider env anywhere except superbrain's own .env. So "configured in Superpanel" remains the open half: provisioning is manual env today. (The Superpanel AI page seen in earlier screenshots lives on the other core, which is outside this repo's ops scope.)
Keeping open for the Superpanel contract only; the "use it" half is demonstrated working.
**Checked 2026-11-09 on the erwin core (1.2.6), per the original ask ("if a Core has AI configured for the Core, use that"):**
The mechanism works as designed and is verified live: with the house key in the app env, `/api/ai/status` (via a throwaway API key, revoked after) reports `{"effective":"server","plan":"core","serverAvailable":true}` and `/api/ai/test` returns pong — i.e. every core user gets the core's AI with zero per-user config, and a per-user BYO row would still take precedence.
Two findings while checking:
1. **Model slugs can rot per egress route.** `nvidia/nemotron-3-ultra-550b-a55b:free` answered 200 from the dev host but hung at connect level from erwin (so `/api/ai/test` died with an empty reply at Go's 60s WriteTimeout); `google/gemma-4-31b-it:free` 429s instantly from erwin. Core's `AI_MODEL` is now `nvidia/nemotron-3.5-lightning:free`, probed 200 from the core itself and re-verified end-to-end. Rule going forward: probe candidate models FROM the core host before pinning.
2. **The Superpanel-side store still does not exist on erwin** — no AI rows in superpanel's `app_config`, Hermes not installed, no provider env anywhere except superbrain's own `.env`. So "configured in Superpanel" remains the open half: provisioning is manual env today. (The Superpanel AI page seen in earlier screenshots lives on the other core, which is outside this repo's ops scope.)
Keeping open for the Superpanel contract only; the "use it" half is demonstrated working.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
If a Core has AI configured for the Core, use that.
Where does Superpanel actually store the per-app AI config? Or does that even exist?
Derek can show you this Moday.
Status note while we wait for Derek's Superpanel walkthrough (Monday):
What already exists on the Superbrain side:
1.1.1) resolves first.AI_API_KEY/AI_MODEL/AI_BASE_URLon the app container, plan-gated byentitlements.AllowServerAI— the core plan (whichTIER=corederives) is included and itsAIModeiscore("house Core AI settings"). So a core install whose operator supplies the house key in the app.envalready gets "use the Core AI" with zero per-user setup;GET /api/ai/statusthen reportseffective: server, and the UI shows it as the source.superbrain-mcpMCP server (mcp/) let the house AI agents on core (Hermes /mcphubvia themcpservergateway) reach Superbrain data; gated on themcp-coreconnector, core plan only.config_mcpserver_superbrain()indeploy/federated/lib-superbrain.shmints the gateway's key.Still missing is exactly the open question from my last comment: where Superpanel stores the per-core AI configuration and how it is provisioned into the app's
.env(or exposed as an API Superbrain should call). Keeping this open until that contract is defined; the fallback path above means the feature degrades gracefully to BYO until then.Status update (post-1.2.1):
Half resolved — the in-app AI half. Core's
.envcarried the house OpenRouter key but pointedAI_MODELatrecursive/flint-v1.0:free, which OpenRouter now answers 503 "no upstreams available", so the server-key path was silently dead. Model switched to a live free slug and the app recreated: SSO users on core now geteffective: serverin/api/ai/statuswith zero per-user setup. This is operator-env provisioning; the automatic half (Superpanel pushing its core-AI config into Superbrain) still waits on the storage contract from Derek's walkthrough.The other half is the MCP attach — per the framing in this thread, "use the Core AI" for Superbrain means what every other suite app gets: the house AI (Superpanel-configured LLM behind Hermes) reaches Superbrain data through the mcpserver gateway, with no LLM config inside Superbrain at all. That work is tracked in the dedicated MCP issue (see below); everything Superbrain-side for it shipped in 1.2.0/1.2.1.
Keeping this issue open for: (a) the Superpanel auto-provisioning contract, and (b) confirmation that the MCP attach satisfies the original ask.
Cross-reference correction: the dedicated MCP-attach tracker is #11 ("Can connect to Federated Core agent for various MCP actions available in Core"); the interim #17 I opened today was closed as its duplicate. The checklist in #11 is the resolution path for the MCP half of this issue.
How AI in Superbrain works — canonical explainer (supersedes my earlier status notes in this thread; code references are to tag 1.2.3).
1. Two config sources, resolved per request in this order (
internal/ai):UserAiConfigrow): provider (openai-compatible / anthropic / gemini), base URL, model, API key (encrypted at rest, masked in every response, write-only), optional custom instructions, enabled flag. Wins when present and enabled.AI_API_KEY(+ optionalAI_MODEL,AI_BASE_URL,AI_PROVIDER; sane per-provider defaults, incl. a codeDefaultModel) in the app container's env. Plan-gated:entitlements.AllowServerAIpermits premium/core/selfhosted; free and standard are BYO-only. A core install (TIER=core→ plancore,AIMode"core") is precisely the "house Core AI" case this issue asks for.GET /api/ai/statusreturns{userConfigured, userEnabled, serverAvailable, effective: user|server|none, plan}so the UI states availability without guessing entitlements.2. What consumes the resolved config:
POST /api/ai/chat): ephemeral multi-turn; server-owned persona; the user's instructions ride along as a delimited section; may propose automations (same schema as the compiler); history lives in the browser.POST /api/agent/compile) and assistant proposals: natural language →Spec; the validator, not the model, decides what a proposal is; closed action set (notify / email / bookmark); fire caps (5 emails per task, 20 per owner per day); 15-minute poll floor; fetched page content is untrusted, delimited data — the model never chooses actions or gains an instruction path.url_watchfetches through netguard and the LLM extracts against the stored question; mailbox-signal triggers need no AI.POST /api/ai/test: one-token probe so misconfiguration fails loudly in Settings, not mid-task.3. What does NOT use this config: the MCP attach (#11). There, the house agent (Hermes, running whatever LLM Superpanel configures) reaches Superbrain data through
superbrain-mcp— no in-app LLM involved. That is the "every app has an MCP attached" path and needs zero AI config inside Superbrain.4. Operational state (2026-11-03):
effective: server, test probe pong, assistant answers, compile → validated spec, task run fired and the agent created a bookmark in the workspace..env, butAI_MODELpointed atrecursive/flint-v1.0:free, which OpenRouter now answers 503 "no upstreams available" — switched to a live free slug and the app recreated, so SSO users geteffective: servereven on 1.0.1. The 1.2.x upgrade (API keys, MCP, toolbar, light mode) awaits image publication (DockerHub secrets).DefaultModelwas the same dead slug; fixed in 1.2.3 soAI_API_KEY-only deployments don't inherit a dead default.5. What this issue still asks for: automatic provisioning of source 2 from Superpanel ("if it is configured in Superpanel"). The contract — where Superpanel keeps the core-AI config (per the UI caption: the Hermes environment file) and how it reaches Superbrain's env — is the open unknown from Derek's walkthrough. Until then, operator env provisioning is the mechanism and this issue stays open for that contract, plus a decision on whether the MCP attach (#11) satisfies the original ask.
6. Ops caveat: OpenRouter free slugs rotate (flint died between 1.2.0 and today). If a model 503s, swapping
AI_MODELis a one-line env change + app recreate — no rebuild, no release.Moved to Plane.
MCP half of this issue is now live on the erwin core: the house AI gateway (mcphub) exposes all 14 superbrain tools — see the closure note on #11 for evidence and the interim gateway image. Remaining here: the Superpanel auto-provisioning contract for the in-app AI half (server-key slot already working on core).
Checked 2026-11-09 on the erwin core (1.2.6), per the original ask ("if a Core has AI configured for the Core, use that"):
The mechanism works as designed and is verified live: with the house key in the app env,
/api/ai/status(via a throwaway API key, revoked after) reports{"effective":"server","plan":"core","serverAvailable":true}and/api/ai/testreturns pong — i.e. every core user gets the core's AI with zero per-user config, and a per-user BYO row would still take precedence.Two findings while checking:
nvidia/nemotron-3-ultra-550b-a55b:freeanswered 200 from the dev host but hung at connect level from erwin (so/api/ai/testdied with an empty reply at Go's 60s WriteTimeout);google/gemma-4-31b-it:free429s instantly from erwin. Core'sAI_MODELis nownvidia/nemotron-3.5-lightning:free, probed 200 from the core itself and re-verified end-to-end. Rule going forward: probe candidate models FROM the core host before pinning.app_config, Hermes not installed, no provider env anywhere except superbrain's own.env. So "configured in Superpanel" remains the open half: provisioning is manual env today. (The Superpanel AI page seen in earlier screenshots lives on the other core, which is outside this repo's ops scope.)Keeping open for the Superpanel contract only; the "use it" half is demonstrated working.