Skip to content

feat(bedrock): serve a workflow agent runner on Amazon Bedrock AgentCore - #494

Open
pablochacin wants to merge 2 commits into
mainfrom
feat/agent-bedrock
Open

pablochacin wants to merge 2 commits into
mainfrom
feat/agent-bedrock

Conversation

@pablochacin

@pablochacin pablochacin commented Nov 30, 2026 •

Copy link
Copy Markdown

What and why

Adds diagrid.agent.bedrock, which serves a diagrid agent runner on Amazon Bedrock AgentCore Runtime. It supports the runners of every framework extension except HolmesGPT. How it works and how to configure it is in diagrid/agent/bedrock/README.md. The new bedrock extra installs it.

Also adds AGENT_WORKER. With AGENT_WORKER=false or 0, a runner starts runs and reads their state, but does not execute them: workers in other processes of the same App ID do. Unset, or any other value, keeps today's behaviour. This lets an agent on AgentCore run as a front end with separate workers.

How it was tested

  • New unit tests for BedrockRunner, its adapters, and AGENT_WORKER on the base and LangGraph runners.
  • uv run pytest tests -m "not integration": 1081 passed, 4 skipped.
  • Not run on AgentCore or against a Dapr sidecar from this branch.

Checklist

  • uv run ruff format (no path arguments, so examples/ is covered too)
  • uv run flake8 diagrid tests --ignore=E501,F401,W503,E203,E704
  • uv run mypy --config-file mypy.ini
  • uv run pytest tests -m "not integration"
  • New or changed behaviour has tests
  • New files under diagrid/ carry the license header
  • Commits are signed off (git commit -s): the AGENT_WORKER commit is not

🤖 Generated with Claude Code

pablochacin and others added 2 commits November 30, 2026 18:59
With AGENT_WORKER set to false or 0, BaseWorkflowRunner.start() creates
only the workflow client and does not start the workflow runtime. The
process starts runs and reads their state, and a worker in another
process of the same App ID executes them. This lets an agent run as a
front end that serves requests, with separate workers, for example on
Amazon Bedrock AgentCore. Unset, or any other value, keeps the current
behaviour.

The LangGraph runner's own shutdown() gets the same guard. Strands'
DurableAgent does not read the variable; its docstring says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds diagrid.agent.bedrock. BedrockRunner takes the workflow runner of a
diagrid agent and serves it on the AgentCore Runtime HTTP contract:
POST /invocations and GET /ping on port 8080. Each AgentCore session runs
its tasks as the workflow instance named after the session ID. A request
while the session's run is unfinished waits for that run instead of
starting another, so a request after a restart resumes it.

An adapter per runner type says how to start a run and where it stores
its task and answer. There are adapters for the Strands, OpenAI Agents,
Pydantic AI, ADK, Claude Agent SDK, LangChain, smolagents, CrewAI,
LangGraph and Deep Agents runners. HolmesGPT is not supported: its runs
can wait for a tool approval, which the AgentCore contract cannot send.

Importing the package copies the keys of the AWS Secrets Manager secret
named by AGENT_SECRET_ARN into the environment, before the Dapr SDK reads
it. The new bedrock extra installs boto3 for that, and is part of all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
@pablochacin
pablochacin marked this pull request as ready for review November 30, 2026 22:15
@pablochacin
pablochacin requested a review from a team as a code owner November 30, 2026 22:15
@CasperGN CasperGN self-assigned this Nov 30, 2026

@msfussell msfussell left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity can we check the name here of the package?First this is for AgentCore rather than Bedrock. Second I would expect AWS in the name to make it clear. Can we check this name.

This branch has not been deployed

No deployments
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.

3 participants