Skip to content

2.0 plan: phase 4 split into seven PRs (#277) - #346

Merged
antiv merged 1 commit into
mainfrom
plan-phase-4-split
Nov 13, 2026
Merged

antiv merged 1 commit into
mainfrom
plan-phase-4-split

Conversation

@antiv

@antiv antiv commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Splits phase 4 (provider keys per workspace) into seven PRs in documents/design/2.0-plan.md, as #332 did for phase 3, with what the code does today and the decisions behind the split.

The PRs

  • 4a, schema and the secret key (V049): workspace_provider_keys and workspace_settings; production refuses to start without MATE_SECRET_KEY.
  • 4b, one place for credentials, and the LiteLLM models: model_credentials(context, model_name), passed per call to both runtimes' LiteLLM clients. It covers the agent model, the fallback model, subagents and the compaction summarizer.
  • 4c, native Gemini and File Search: the workspace's google key through ADK's client_kwargs.
  • 4d, the other model calls: the image tool and the workspace image model, embeddings, the eval judge, the improver, Work Room titles, the hallucination guardrail and the mystery game tools.
  • 4e, Workspace settings → Models and keys: owners set the keys (shown masked) and the image model, with an audit entry.
  • 4f, an end-to-end test: an OpenRouter-only workspace with no platform keys, with the environment cleared.
  • 4g, the review of the phase.

Decisions worth a look

  • The key is looked up on every model call, so nothing needs a reload.
  • The order: the agent's own key, then the workspace key, then the environment (only where the workspace may use it), then the refusal This workspace has no key for <provider>. It happens at call time, and the fallback model doesn't answer it.
  • "Environment" covers endpoints too (OLLAMA_HOST, ...).
  • The default workspace always may use platform keys.
  • workspace_settings is a table of its own, not system_settings.workspace_id. It starts with the image model; the judge, title and embedding models stay installation-wide names.
  • Keys are saved only when MATE_SECRET_KEY is set.
  • MATE_SECRET_KEY becoming required in production (1.6 groundwork item 9) had no phase, so 4a takes it. It is added to the release notes.
  • The "billed on its own key" check stays manual, with a real key, on the production-copy instance before 2.0.0.

Docs: plan only; no guide changes.

@antiv antiv mentioned this pull request Nov 13, 2026
22 tasks done
@antiv
antiv merged commit 85aad2e into main Nov 13, 2026
2 checks passed
@antiv
antiv deleted the plan-phase-4-split branch November 13, 2026 15:27
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