Skip to content

fix(selfhost): deliver MULTICA_LLM_* to the backend and log the layer state - #6240

Open
forrestchang wants to merge 2 commits into
mainfrom
agent/lambda/llm-env-plumbing
Open

fix(selfhost): deliver MULTICA_LLM_* to the backend and log the layer state#6240
forrestchang wants to merge 2 commits into
mainfrom
agent/lambda/llm-env-plumbing

Conversation

@forrestchang

Copy link
Copy Markdown
Collaborator

What

Adds MULTICA_LLM_API_KEY / MULTICA_LLM_BASE_URL / MULTICA_LLM_DEFAULT_MODEL to the self-host compose backend environment, and logs one line at startup saying whether the LLM layer came up enabled.

Why

docker-compose.selfhost.yml enumerates the backend's environment explicitly and has no env_file:. The three MULTICA_LLM_* vars were not in that list, so setting them in .env had no effect — they never reached the container. .env.example documents all three, which made the layer look configurable when on compose it could not be turned on at all.

Everything gated on that layer was therefore permanently off for compose deployments:

  • chat auto-titling (silently keeps the first-message title)
  • chat follow-up suggestions / quick actions

This was survivable while quick actions were generated by the daemon's own provider pass, which needs no server-side key. MUL-5573 (#6214) moved generation server-side and removed the daemon path — so on these deployments the feature went from working to absent, with no error anywhere.

Helm is unaffected in capability: it mounts an operator-managed Secret with envFrom, so the keys can already be supplied. It just wasn't documented. values.yaml now says so.

The startup line

llm layer enabled   default_model=...
llm layer disabled  set MULTICA_LLM_API_KEY or MULTICA_LLM_BASE_URL to enable ...

Every consumer of this layer degrades quietly on purpose, so an unset key looked identical to a broken feature. That is precisely how this was reported — "the feature stopped working" — with nothing in the logs to distinguish the two. One line makes it self-diagnosing.

Verification

  • go build ./..., go vet, gofmt clean.
  • internal/handler and internal/service suites pass (run against a throwaway migrated database, dropped afterwards).
  • Both edited YAML files parse.
  • No behavior change when the vars are unset: the passthrough defaults to empty and llm.New yields the same disabled client as before.

… state

Chat auto-titling and chat follow-up suggestions are gated on the server-side
LLM layer, which reads MULTICA_LLM_API_KEY / MULTICA_LLM_BASE_URL through
os.Getenv. The self-host compose file enumerates backend environment
explicitly and has no env_file, and those three vars were not in the list — so
setting them in .env did nothing, the container never saw them, and the layer
was off on every compose deployment regardless of configuration. .env.example
documents them, which made it look configurable.

That was survivable while quick actions were generated by the daemon's own
provider pass, which needed no server key. MUL-5573 moved generation server-
side and removed the daemon path, so on those deployments the feature stopped
appearing entirely rather than degrading.

Adds the passthrough, and one startup line reporting whether the layer is
enabled. Every consumer degrades silently by design, so without that line an
unset key is indistinguishable from a broken feature — which is exactly how
this surfaced. Helm already supports it through the operator-managed Secret;
values.yaml now says so instead of leaving it undocumented.

Co-authored-by: multica-agent <github@multica.ai>
@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
multica-docs Ready Ready Preview Jul 31, 2026 9:01am

Request Review

The only existing coverage called the generator directly. Everything between
the completion callback and the pills landing on the row — the eligibility
decision, the chat:done flag, the detached dispatch — went untested, which is
exactly the stretch you have to rule out when the feature 'just does not
appear'.

Co-authored-by: multica-agent <github@multica.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant