feat(self_hosted_sandboxes): add AgentCore Runtime variant#689
Open
didhd wants to merge 1 commit into
Open
Conversation
Adds agentcore/, an AWS Bedrock AgentCore Runtime variant of the self-hosted sandbox demo. Same `ant beta:worker run` entrypoint as docker/; the per-session container is replaced by an AgentCore microVM addressed by runtimeSessionId == ANTHROPIC_SESSION_ID. Operator TUI uses the GA Interactive Shells API (2026-06-05): tui_shell.py speaks InvokeAgentRuntimeCommandShell via the bedrock-agentcore SDK open_shell(); tui_exec.py uses InvokeAgentRuntimeCommand for one-shot. End-to-end verified on us-west-2 with claude-haiku-4-5: poll -> invoke_agent_runtime -> agent writes /workspace -> operator attaches via open_shell() and sees live files; reconnect preserves shell state.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
agentcore/, an AWS Bedrock AgentCore Runtime variant of the self-hosted sandbox demo. Sameant beta:worker runentrypoint as the existingdocker/variant; each per-session container is replaced by an AgentCore Runtime microVM addressed by session affinity (runtimeSessionId == ANTHROPIC_SESSION_ID).The host runs
ant beta:worker polland forwards each work item to AgentCore viaboto3.invoke_agent_runtime. Inside the microVM,server.py(@app.entrypoint) spawnsant beta:worker runto attach to that one session's SSE and run bash/read/write/edit/glob/grep tools in/workspace. No org API key reaches the runner — only the environment key is passed in the invoke payload.Operator TUI — GA Interactive Shells
Unlike the other compute variants, this one offers an operator surface into the live per-session microVM:
tui_exec.py— one-shotInvokeAgentRuntimeCommand(HTTP stream).tui_shell.py— interactive PTY via the GAInvokeAgentRuntimeCommandShellAPI (launched 2026-06-05), using the officialbedrock-agentcoreSDKAgentCoreRuntimeClient.open_shell(). Supports--shell-idreconnect (server replays up to 256 KB) and SIGWINCH resize.Testing
End-to-end verified on us-west-2 with
claude-haiku-4-5:poll → claim → invoke_agent_runtime → agent writes /workspace/hello/ → operator attaches via open_shell() and sees the live files. Reconnect preserves shell state (env vars/cwd).ruff check+ruff format --checkpass.