Description
Currently, the sandbox instance (e.g., Docker container) is eagerly initialized when the agent is called. This leads to:
- Unnecessary resource consumption (CPU/memory/network) if the agent never uses sandbox tools
- Slower agent startup time, especially in serverless or cold-start scenarios
To improve efficiency and align with on-demand execution patterns, we propose implementing lazy loading for sandbox instances:
The actual sandbox instance should only be created at the moment a tool requiring it is first invoked.
This matches best practices in cloud-native systems (e.g., lazy DB connections, just-in-time executors).