Skip to content

Conversation

@zdql
Copy link
Contributor

@zdql zdql commented Nov 5, 2025

No description provided.

@vercel
Copy link
Contributor

vercel bot commented Nov 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
assistant-ui-template Ready Ready Preview Comment Nov 5, 2025 4:06pm
echo-control (staging) Ready Ready Preview Comment Nov 5, 2025 4:06pm
echo-next-boilerplate Ready Ready Preview Comment Nov 5, 2025 4:06pm
echo-next-image Ready Ready Preview Comment Nov 5, 2025 4:06pm
echo-next-sdk-example Ready Ready Preview Comment Nov 5, 2025 4:06pm
echo-video-template Ready Ready Preview Comment Nov 5, 2025 4:06pm
echo-vite-sdk-example Ready Ready Preview Comment Nov 5, 2025 4:06pm
next-chat-template Ready Ready Preview Comment Nov 5, 2025 4:06pm
react-boilerplate Ready Ready Preview Comment Nov 5, 2025 4:06pm
react-chat Ready Ready Preview Comment Nov 5, 2025 4:06pm
react-image Ready Ready Preview Comment Nov 5, 2025 4:06pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
component-registry Skipped Skipped Nov 5, 2025 4:06pm

@railway-app
Copy link

railway-app bot commented Nov 5, 2025

🚅 Deployed to the echo-pr-668 environment in echo

Service Status Web Updated (UTC)
echo ◻️ Removed (View Logs) Web Nov 5, 2025 at 4:13 pm

Copy link
Contributor

@vercel vercel bot left a comment

Choose a reason for hiding this comment

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

Additional Suggestion:

The code uses process.env.GOOGLE_SERVICE_ACCOUNT_KEY_ENCODED directly instead of accessing it through the centralized env object, and this environment variable is not defined in the env.ts configuration schema.

View Details
📝 Patch Details
diff --git a/packages/app/server/src/env.ts b/packages/app/server/src/env.ts
index 473efd0c..4738d41a 100644
--- a/packages/app/server/src/env.ts
+++ b/packages/app/server/src/env.ts
@@ -47,6 +47,7 @@ export const env = createEnv({
     TAVILY_API_KEY: z.string().optional(),
     E2B_API_KEY: z.string().optional(),
     GOOGLE_SERVICE_ACCOUNT_KEY: z.string().optional(),
+    GOOGLE_SERVICE_ACCOUNT_KEY_ENCODED: z.string().optional(),
 
     // API Keys - Echo
     API_KEY_HASH_SECRET: z.string().default('change-this-in-production-very-secret-key'),
diff --git a/packages/app/server/src/providers/VertexAIProvider.ts b/packages/app/server/src/providers/VertexAIProvider.ts
index 3a59994e..fe9b113b 100644
--- a/packages/app/server/src/providers/VertexAIProvider.ts
+++ b/packages/app/server/src/providers/VertexAIProvider.ts
@@ -472,8 +472,7 @@ export class VertexAIProvider extends BaseProvider {
   }
 
   private getServiceAccountCredentials(): any {
-    const serviceAccountKeyEncoded =
-      process.env.GOOGLE_SERVICE_ACCOUNT_KEY_ENCODED;
+    const serviceAccountKeyEncoded = env.GOOGLE_SERVICE_ACCOUNT_KEY_ENCODED;
     // decode from base64
     const serviceAccountKey = Buffer.from(
       serviceAccountKeyEncoded!,

Analysis

VertexAIProvider uses process.env directly instead of centralized env object

What fails: VertexAIProvider.getServiceAccountCredentials() accesses process.env.GOOGLE_SERVICE_ACCOUNT_KEY_ENCODED directly, while all other providers use the centralized env object pattern

How to reproduce:

// When GOOGLE_SERVICE_ACCOUNT_KEY_ENCODED is undefined:
const serviceAccountKeyEncoded = process.env.GOOGLE_SERVICE_ACCOUNT_KEY_ENCODED; // undefined
const result = Buffer.from(serviceAccountKeyEncoded!, 'base64'); // Runtime error

Result: TypeError: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined

Expected: Should follow the established pattern used by AnthropicGPTProvider, GPTProvider, and others: env.GOOGLE_SERVICE_ACCOUNT_KEY_ENCODED with proper Zod validation

@railway-app railway-app bot temporarily deployed to echo (echo / staging) November 5, 2025 15:33 Inactive
Comment on lines 73 to +77
logMetric('facilitator_proxy_failure', 1, {
method,
status: res.status,
});
throw new Error(`Proxy facilitator failed for ${method}: ${errorMsg}`);
throw new FacilitatorProxyError();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
logMetric('facilitator_proxy_failure', 1, {
method,
status: res.status,
});
throw new Error(`Proxy facilitator failed for ${method}: ${errorMsg}`);
throw new FacilitatorProxyError();
const errorBody = await res.text();
const errorMsg = `${res.status} ${res.statusText} - ${errorBody}`;
logMetric('facilitator_proxy_failure', 1, {
method,
status: res.status,
});
throw new FacilitatorProxyError(`Proxy facilitator failed for ${method}: ${errorMsg}`);

The error handling in facilitatorProxy has lost critical debugging information. When a facilitator request fails, the response body and status text are no longer captured or included in the error, making troubleshooting very difficult.

View Details

Analysis

Lost error details in facilitatorProxy error handling

What fails: facilitatorProxy() in facilitatorProxy.ts throws generic FacilitatorProxyError without capturing response body or status text when facilitator requests return non-200 status codes

How to reproduce:

  1. Trigger a facilitator request that returns non-200 status (e.g., 503 Service Unavailable)
  2. Current error: "FacilitatorProxyError - all facilitators are busy. Please retry after a few seconds."
  3. Missing: Actual HTTP status text and response body with specific error details

Result: Developers lose critical debugging information. A 503 with detailed maintenance message becomes indistinguishable from a 429 rate limit error.

Expected: Error should include HTTP status, status text, and response body as it did before commit 09a28f2 (Nov 5, 2025)

Git evidence: Commit 09a28f2 removed lines capturing errorBody = await res.text() and errorMsg = and replaced with generic throw new FacilitatorProxyError()

@zdql zdql merged commit 957b24c into production Nov 5, 2025
19 of 21 checks passed
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.

2 participants