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(ui): a Vertex card no longer asks for a key it cannot use

Harald499f88d09370
diff --git a/jarvis/ui/web/frontend/src/components/ApiKeyForm.tsx b/jarvis/ui/web/frontend/src/components/ApiKeyForm.tsx
index f9542835eb..f69cfcad91 100644
--- a/jarvis/ui/web/frontend/src/components/ApiKeyForm.tsx
+++ b/jarvis/ui/web/frontend/src/components/ApiKeyForm.tsx
@@ -24,6 +24,15 @@ interface ApiKeyFormProps {
* demanding a second key the runtime does not need.
*/
effectiveConfigured?: boolean;
+ /**
+ * Why this card is already served WITHOUT a key, in the provider's own
+ * words. When set, it replaces the generic "covered by your shared key"
+ * line — because for Vertex the truth is not "a shared key covers you" but
+ * "there is no key here at all, and an ordinary Cloud API key would not
+ * work if you pasted one". An empty input asks a question the card has
+ * already answered.
+ */
+ coveredNote?: string | null;
/**
* Labels of the OTHER provider surfaces that read this same slot at
* runtime. Non-empty ⇒ deleting asks for confirmation, because the delete
@@ -63,7 +72,7 @@ function announceSecretChange(secretKey: string, action: "set" | "delete") {
* existing value. Writes directly to POST /api/secrets/{key}; the value
* never leaves the frontend again after submit (read-only flag in the backend).
*/
-export function ApiKeyForm({ secretKey, dashboardUrl, configured, credentialHelp, effectiveConfigured, sharedWith, onChanged, onSavedActivate }: ApiKeyFormProps) {
+export function ApiKeyForm({ secretKey, dashboardUrl, configured, credentialHelp, effectiveConfigured, coveredNote, sharedWith, onChanged, onSavedActivate }: ApiKeyFormProps) {
const t = useT();
const [value, setValue] = useState("");
const [pending, setPending] = useState(false);
@@ -223,7 +232,7 @@ export function ApiKeyForm({ secretKey, dashboardUrl, configured, credentialHelp
return (
<div className="space-y-2">
<p className="text-[11px] leading-relaxed text-muted-foreground">
- {t("apikeys_view.shared_key_covered")}
+ {coveredNote || t("apikeys_view.shared_key_covered")}
</p>
<Button size="sm" variant="ghost" onClick={() => setEditing(true)}>
{t("apikeys_view.add_dedicated_key")}
diff --git a/jarvis/ui/web/frontend/src/components/providers/ProviderTierSection.tsx b/jarvis/ui/web/frontend/src/components/providers/ProviderTierSection.tsx
index ab0a680301..c53092d3e8 100644
--- a/jarvis/ui/web/frontend/src/components/providers/ProviderTierSection.tsx
+++ b/jarvis/ui/web/frontend/src/components/providers/ProviderTierSection.tsx
@@ -3478,6 +3478,7 @@ export function AuthWidget({
dashboardUrl={descriptor.dashboard_url}
configured={Boolean(descriptor.secrets_set[k])}
effectiveConfigured={Boolean(descriptor.secrets_effective?.[k])}
+ coveredNote={descriptor.credential_note ?? null}
sharedWith={descriptor.secret_shared_with?.[k] ?? []}
credentialHelp={descriptor.credential_help}
onChanged={onChanged}
@@ -3501,6 +3502,7 @@ export function AuthWidget({
dashboardUrl={descriptor.dashboard_url}
configured={Boolean(descriptor.secrets_set[k])}
effectiveConfigured={Boolean(descriptor.secrets_effective?.[k])}
+ coveredNote={descriptor.credential_note ?? null}
sharedWith={descriptor.secret_shared_with?.[k] ?? []}
credentialHelp={descriptor.credential_help}
onChanged={onChanged}
diff --git a/jarvis/ui/web/frontend/src/hooks/useProviders.ts b/jarvis/ui/web/frontend/src/hooks/useProviders.ts
index ec4cc810b1..80d66893d9 100644
--- a/jarvis/ui/web/frontend/src/hooks/useProviders.ts
+++ b/jarvis/ui/web/frontend/src/hooks/useProviders.ts
@@ -57,6 +57,8 @@ export interface ProviderDescriptor {
* cached older payloads keep parsing.
*/
secrets_effective?: Record<string, boolean>;
+ /** Why the card is ready WITHOUT a key (Vertex's Cloud project path). */
+ credential_note?: string | null;
/** Other provider surfaces (labels) that read the same slot at runtime. */
secret_shared_with?: Record<string, string[]>;
dashboard_url: string | null;
diff --git a/jarvis/ui/web/provider_routes.py b/jarvis/ui/web/provider_routes.py
index 43cbdb202c..d5beea807e 100644
--- a/jarvis/ui/web/provider_routes.py
+++ b/jarvis/ui/web/provider_routes.py
@@ -57,6 +57,20 @@ from .provider_spec import (
log = logging.getLogger(__name__)
+#: Why a card is ready WITHOUT a key, per provider id. Shown in place of the
+#: empty key input, because an empty input is a question ("give me a key") and
+#: these cards are already answered. Vertex is the case: its Cloud project path
+#: signs with Application Default Credentials, and it refuses ordinary Cloud API
+#: keys — so the input was not merely unnecessary there, it pointed at a
+#: credential that cannot work.
+_KEYLESS_CREDENTIAL_NOTES: dict[str, str] = dict.fromkeys(
+ ("vertex", "vertex-stt", "vertex-tts", "vertex-live"),
+ "Ready through your Google Cloud project — no key needed. Vertex signs "
+ "requests with Application Default Credentials (gcloud auth "
+ "application-default login). A key field is only for a Vertex express-mode "
+ "key (AQ.); an ordinary Google Cloud API key does not work with Vertex.",
+)
+
router = APIRouter(prefix="/api", tags=["providers"])
@@ -504,6 +518,21 @@ def _spec_to_payload(
family_present = False
if family_present:
secrets_effective = dict.fromkeys(spec.secret_keys, True)
+ # A key is not the only credential there is. Vertex AI's Google Cloud
+ # project path signs with Application Default Credentials and stores
+ # nothing in any slot, so the loop above leaves the card showing an empty
+ # "Paste your key here…" box — which every reader takes as "you must supply
+ # a key", when in fact Vertex refuses ordinary Cloud API keys outright. The
+ # field report that produced this: "what exactly does the user have to
+ # bring? I don't get it." Same shape as the family-fallback case above:
+ # report what the runtime will actually do.
+ credential_note: str | None = None
+ if spec.auth_mode == "api_key" and not any(secrets_effective.values()):
+ from jarvis.brain.app_control import _keyless_credential_present
+
+ if _keyless_credential_present(spec.id):
+ secrets_effective = dict.fromkeys(spec.secret_keys, True)
+ credential_note = _KEYLESS_CREDENTIAL_NOTES.get(spec.id)
from .provider_spec import secret_slot_consumers
secret_shared_with = {
@@ -530,6 +559,9 @@ def _spec_to_payload(
# slot; the form renders "covered by your shared key" and warns
# before deleting a key that other tiers still read.
"secrets_effective": secrets_effective,
+ # Set only when the card is ready WITHOUT a key; the form shows this
+ # instead of an empty input (see _KEYLESS_CREDENTIAL_NOTES).
+ "credential_note": credential_note,
"secret_shared_with": secret_shared_with,
"dashboard_url": spec.dashboard_url,
"login_cli": list(spec.login_cli) if spec.login_cli else None,