Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion open-sse/executors/vertex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,14 @@ export async function getAccessToken(sa: ServiceAccount): Promise<string> {
aud: "https://oauth2.googleapis.com/token",
iat: now,
exp: now + 3600,
scope: "https://www.googleapis.com/auth/cloud-platform",
// cloud-platform authorizes Vertex AI (aiplatform.googleapis.com) for chat/image execution.
// generative-language.retriever is ADDITIONALLY required so model discovery can list the live
// catalog from generativelanguage.googleapis.com/v1beta/models — without it that listing returns
// 403 ACCESS_TOKEN_SCOPE_INSUFFICIENT and discovery silently falls back to the static ~10-model
// registry list. Requesting the extra scope is harmless for execution (cloud-platform still
// present) and for projects where it isn't needed (the mint never validates scope availability).
scope:
"https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/generative-language.retriever",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

According to the Repository Style Guide (Rule 9), changing production code in 'open-sse/' requires including or updating tests. Please add corresponding tests in the 'tests/' directory to cover this scope change.

References
  1. Always include tests when changing production code (src/, open-sse/, electron/, bin/). (link)

})
.setProtectedHeader({ alg: "RS256", kid: sa.private_key_id })
.sign(privateKey);
Expand Down