Skip to content

feat(agents): add unified AgentKit remote sandbox agent - #1066

Draft
zakahan wants to merge 3 commits into
volcengine:mainfrom
zakahan:feat/agentkit-remote-sandbox-agent
Draft

feat(agents): add unified AgentKit remote sandbox agent#1066
zakahan wants to merge 3 commits into
volcengine:mainfrom
zakahan:feat/agentkit-remote-sandbox-agent

Conversation

@zakahan

@zakahan zakahan commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add AgentkitRemoteSandboxAgent so a coordinator can transfer tasks to an AgentKit sandbox through sub_agents. The remote agent yields native ADK events, exposing its tool calls, tool results and incremental output directly to the Runner and Web UI without requiring another coordinator model call to summarize the result.

from veadk import Agent, AgentkitRemoteSandboxAgent

root_agent = Agent(
    name="coordinator",
    instruction="Transfer sandbox execution tasks to sandbox.",
    sub_agents=[AgentkitRemoteSandboxAgent(
        name="sandbox",
        tool_id="your-tool-id",
        # tool_type="CodeEnv",  # optional: Skill or CodeEnv
        request_timeout=900,
        expiry_buffer=90,
    )],
)
  • Explicit tool_type takes precedence. Otherwise, lazy GetTool discovery accepts only Skill or CodeEnv; other types fail with an actionable error. Import and construction do not create remote sessions.
  • Skill uses public A2A client APIs, supports streaming and polling, and preserves available structured tool events, including results in non-streaming task history.
  • CodeEnv uses a compatible Sidecar HTTP/SSE v1 endpoint with replay cursors, idempotent submission and cancellation. Sidecar events map directly to ADK events without an A2A conversion.
  • Session handling scopes bindings by caller and conversation, checks remaining lifetime, rotates physical sessions and recovers ambiguous session creation. Credentials are resolved per invocation.
  • Close the delegated ADK async generator explicitly in Agent so transfer cleanup keeps tracing context correctly scoped.

Validation

Validated at commit 203d9ec8 with Google ADK 2.2.0:

  • 27 tests passed across the new sandbox agent/session tests and existing agent/transfer contracts, including concurrent user isolation, cancellation, streaming/polling and a real ADK A2A server in both modes.
  • Pre-commit passed: Ruff lint/format and hardcoded-secret scanning.
  • An external actual-image CodeEnv gateway case exercised the real Sidecar and Codex binary with a deterministic model, verified command execution and file output, and observed paired child tool events and text increments through the native /run_sse route before remote completion.
  • VeADK Web CLI smoke verified app discovery, session creation and the UI endpoint.

Live cloud Tools, production models and browser DOM rendering were not part of this validation. CodeEnv requires a compatible Sidecar image; a remote Skill service must emit tool metadata for it to be displayed. Input currently supports text tasks, and physical session rotation does not migrate files or remote context. See veadk/agents/REMOTE_SANDBOX.md for usage and lifecycle boundaries.

@zakahan
zakahan marked this pull request as draft September 7, 2026 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant