Skip to main content

Gemini Manual Function Calling Runs as the Right User

With Automatic Function Calling turned off, GeminiProvider.handle_response(response) in composio-gemini executed each function call with the executor stored by the latest tools.get() or session.tools() for that tool. When one Composio instance served several users, a call from Alice’s conversation could run with Bob’s user_id and connected account, and Bob’s result went back into Alice’s chat. The callables used by Automatic Function Calling were not affected.

Bug Fixes

  • Gemini (composio-gemini): handle_response accepts user_id= or session=, with the same names as GoogleProvider.handle_response in composio-google. Each call runs exactly as the tool fetched for that user or Tool Router session would: validated against the schema from that fetch (including its schema modifiers), with the modifiers given to tools.get(), and through the session’s routing, so local custom tools in a COMPOSIO_MULTI_EXECUTE_TOOL batch run in process.
  • Without a user or session, handle_response keeps working for a process that has fetched tools for a single user or session. Once the provider has wrapped tools for more than one, it raises a ValueError instead of picking one, and executes nothing.
Before:
After: