Support setting the environment in Custom Tools with Resource Queries of an Agent

Expected Behavior

  • when using an Agent via the Agent Chat component in a Retool App, any resource queries in custom tools defined in this agent should respect the current environment of the App

Actual Behavior

  • Agents always use the first defined environment for resource queries. This behavior doesn't seem to be documented

Additional Expected Behavior

  • the environment of the Agent Custom Tools resource queries could also be configurable in the Agents Section. This would allow for a meaningful Agent development workflows testing resource queries in a pre-production environment.

As mentioned in: Authentication of Agent Custom Tool does not «bubble up» when agent is invoked from Agent Chat Component in a Retool App