Skip to content

Deployed Agent Engine crashes with TypeError: Object of type AuthConfig is not JSON serializable when using any OAuth 2.0 enabled tool. #2035

@ThibaultScalbert

Description

@ThibaultScalbert

Describe the bug
When an agent using any tool that requires OAuth 2.0 (e.g., OpenAPIToolset, BigQueryToolset) is deployed to Vertex AI Agent Engine, it crashes during the initial tool call.

To Reproduce

  • Error Log:
    1 TypeError: Object of type AuthConfig is not JSON serializable
  • Traceback Analysis: The error occurs within the VertexAiSessionService when it attempts to append the OAuth request event to the session history. The service fails because it cannot serialize the AuthConfig object into JSON.
  • Steps to Reproduce:
    1. Create an agent that uses any tool requiring OAuth 2.0 (e.g., BigQueryToolset with a client_id and client_secret).
    2. Deploy the agent to Vertex AI Agent Engine using vertexai.agent_engines.create().
    3. Query the deployed agent with a prompt that triggers the OAuth-enabled tool.
    4. Observe the FAILED_PRECONDITION error on the client and the TypeError in the server-side Cloud Logs.

Metadata

Metadata

Assignees

Labels

agent engine[Component] This issue is related to Agent Engine deployment

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions