Skip to content

Commit 78094af

Browse files
Update open-sse/executors/antigravity.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 4f69f1c commit 78094af

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

open-sse/executors/antigravity.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,16 @@ export class AntigravityExecutor extends BaseExecutor {
3636
}
3737

3838
transformRequest(model, body, stream, credentials) {
39-
const hasRealProject = !!credentials?.projectId;
40-
const projectId = credentials?.projectId || this.generateProjectId();
39+
const bodyProjectId = body?.project;
40+
const credentialsProjectId = credentials?.projectId;
41+
const hasExplicitProject = !!(bodyProjectId || credentialsProjectId);
42+
const projectId = bodyProjectId || credentialsProjectId || this.generateProjectId();
4143

42-
if (!hasRealProject) {
44+
if (!hasExplicitProject) {
4345
console.warn(
44-
`[Antigravity] ⚠️ No projectId in credentials — using generated fallback "${projectId}". ` +
46+
`[Antigravity] ⚠️ No projectId provided via body or credentials — using generated fallback "${projectId}". ` +
4547
`This may cause 404 errors if the account has no active GCP project. ` +
46-
`Ensure the OAuth token includes a valid project.`
48+
`Ensure the OAuth token includes a valid project or the request includes a project field.`
4749
);
4850
}
4951

0 commit comments

Comments
 (0)