Skip to content

[Bug/Enhancement] Sensitive backend configuration errors are exposed directly to the end-user in the chat UI #95

@Krishanhkr

Description

@Krishanhkr

Currently, when the backend is missing necessary environment variables (like GCP_PROJECT_ID for Vertex AI mode or GOOGLE_API_KEY for standard mode), the application catches the RuntimeError and sends the raw exception message directly to the frontend chat UI as the Assistant's response.

This behavior leaks sensitive backend configuration requirements to the client side and provides a poor user experience. Instead, these errors should be logged internally on the server, and a generic, user-friendly error message should be sent to the client.

Steps to Reproduce:-

1.) Clone the repository and navigate to the project root.

2.) Create a .env file from
.env.template
but leave GCP_PROJECT_ID blank (and keep GEMINI_USE_VERTEX=true).

3.) Run the backend server (uv run backend/main.py) and the frontend React app (npm start).

4.) Type any message, like "hello", into the chat interface and click send.

5.) Notice that the Assistant replies with: Error: GCP_PROJECT_ID must be set for Vertex mode.

Expected Behavior:-
The application should catch configuration exceptions on the backend, log the specific error details (e.g., missing API keys) to the server console for the developer, and return a safe, generic response to the user. For example: "I'm sorry, my backend connection is currently misconfigured. Please contact the administrator."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions