Skip to content

[Feature Request] Support Lazy Initialization for Sandbox — Create on First Tool Invocation #73

@xuehuitian45

Description

@xuehuitian45

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).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions