Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

fix(vertex): the key field on a Vertex card could not save

Harald535ada8b3a3a
diff --git a/jarvis/setup/wizard.py b/jarvis/setup/wizard.py
index b89f223e8f..1da1940d1a 100644
--- a/jarvis/setup/wizard.py
+++ b/jarvis/setup/wizard.py
@@ -177,6 +177,45 @@ SECRETS: list[SecretSpec] = [
required_for="Brain (Gemini)",
section="brain",
),
+ # Vertex AI. Not prompted during setup: the ordinary Vertex path is a Cloud
+ # project signed with Application Default Credentials and stores no key at
+ # all, so asking for one in the wizard would be asking for the exception.
+ # The slots must still be DECLARED — this table is what the Control API
+ # accepts as a writable secret, and without a row here saving from the
+ # Vertex card fails with "Unknown secret key" (field report 2026-08-17).
+ SecretSpec(
+ key="vertex_api_key",
+ env_fallback="VERTEX_API_KEY",
+ label="Vertex AI express-mode API Key",
+ help_url="https://console.cloud.google.com/vertex-ai/studio/settings/api-keys",
+ required_for="Vertex AI (express mode; the Cloud project path needs no key)",
+ section="brain",
+ prompt=False,
+ ),
+ SecretSpec(
+ key="google_vertex_api_key",
+ env_fallback="GOOGLE_VERTEX_API_KEY",
+ label="Vertex AI API Key (alias slot)",
+ help_url="https://console.cloud.google.com/vertex-ai/studio/settings/api-keys",
+ required_for="Vertex AI (compatibility alias)",
+ prompt=False,
+ ),
+ SecretSpec(
+ key="realtime_vertex_api_key",
+ env_fallback="JARVIS_REALTIME_VERTEX_API_KEY",
+ label="Vertex AI Live API Key",
+ help_url="https://console.cloud.google.com/vertex-ai/studio/settings/api-keys",
+ required_for="Realtime Voice (Vertex AI Live)",
+ prompt=False,
+ ),
+ SecretSpec(
+ key="jarvis_agent_vertex_api_key",
+ env_fallback="JARVIS_AGENT_VERTEX_API_KEY",
+ label="Vertex AI API Key for Jarvis-Agents",
+ help_url="https://console.cloud.google.com/vertex-ai/studio/settings/api-keys",
+ required_for="Jarvis-Agents (Vertex AI)",
+ prompt=False,
+ ),
SecretSpec(
key="grok_api_key",
env_fallback="GROK_API_KEY",
diff --git a/tests/unit/web/test_provider_secret_sharing.py b/tests/unit/web/test_provider_secret_sharing.py
index 3a6872582c..6f9b7cadf9 100644
--- a/tests/unit/web/test_provider_secret_sharing.py
+++ b/tests/unit/web/test_provider_secret_sharing.py
@@ -34,3 +34,31 @@ def test_unshared_slot_reports_only_its_own_surface() -> None:
def test_unknown_slot_reports_no_consumers() -> None:
assert secret_slot_consumers("no_such_slot_ever") == []
+
+
+# ── every card's key field must actually be writable ─────────────────────────
+
+
+def test_every_card_secret_slot_is_accepted_by_the_save_route() -> None:
+ """A key field the Control API refuses is a dead end with a Save button.
+
+ The save route validates against ``ALLOWED_SECRET_KEYS``, which is derived
+ from the setup wizard's SECRETS table — a DIFFERENT list from the provider
+ cards' ``secret_keys``. Nothing tied the two together, so a provider could
+ ship a card whose field looked ordinary and answered "Unknown secret key"
+ on save. That is what the four Vertex cards did (field report 2026-08-17):
+ the slots existed everywhere the runtime looks and nowhere the writer does.
+
+ BUG-008 shape — two lists of the same fact — so it gets a guard rather than
+ a fix.
+ """
+ from jarvis.ui.web.provider_routes import ALLOWED_SECRET_KEYS
+ from jarvis.ui.web.provider_spec import PROVIDERS
+
+ declared = {key for spec in PROVIDERS for key in spec.secret_keys}
+ unwritable = sorted(declared - ALLOWED_SECRET_KEYS)
+ assert not unwritable, (
+ "these provider cards render a key field the save route rejects: "
+ f"{unwritable}. Add a SecretSpec row in jarvis/setup/wizard.py "
+ "(prompt=False when setup should not ask for it)."
+ )