feat(bb-agent): run the streaming loop on AgentCore Runtime (keep Realtime) - #368
Draft
pjkroker wants to merge 1 commit into
Draft
feat(bb-agent): run the streaming loop on AgentCore Runtime (keep Realtime)#368pjkroker wants to merge 1 commit into
pjkroker wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 6c5d0c3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
pjkroker
force-pushed
the
agentcore-rt/3-bb-agent
branch
from
August 14, 2026 12:23
4655f2b to
c23f1d4
Compare
pjkroker
force-pushed
the
agentcore-rt/3-bb-agent
branch
from
August 14, 2026 13:20
f2e6a41 to
14894fe
Compare
pjkroker
force-pushed
the
agentcore-rt/3-bb-agent
branch
from
August 14, 2026 13:32
14894fe to
6c5d0c3
Compare
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.
Stacked PR 3 of 3 — the migration. Base:
agentcore-rt/2-realtime-grant(#367), which stacks on #366.Problem
The Agent BB ran its Strands loop inside an AsyncJob (SQS → Lambda), capped by Lambda's 15-min per-invocation limit — long / multi-step agents weren't achievable.
What
Move the loop to a Bedrock AgentCore Runtime (sessions up to 8h) while keeping the Realtime BB as the streaming transport — chunks reach the browser over Realtime exactly as before (per doc 104 §3.2; not AgentCore
/ws).stream()/resume()callInvokeAgentRuntime, which starts the turn as a background async task (addAsyncTask→/pingHealthyBusy) and returns immediately, so the microVM keeps running while the loop publishes chunks to Realtime. Locally the loop still runs in-process against the mock Realtime.stream/resume/getChannel, thechunkschannel, and theuseChatsubscribe contract are unchanged. (ThecreateChatclient redesign — doc 106 — is a separate follow-up.)runtimeconfig flag ('agentcore', the default) records the runtime as an explicit seam.AgentCoreRuntime(synth-time co-bundle of the app backend +serve()harness,RuntimeviafromCodeAsset, Node 22 CodeZip) so it can later become anAgentCoreCompute.BlocksRole(needs feat(core): expose backendModulePath; trust bedrock-agentcore on the shared role #366 + feat(bb-realtime): add Realtime.grantPublish() for external publishers #367), so it inherits every Building Block's grants — including other BBs an agent's tools touch (KVStore, tables). Only Bedrock + Realtime-publish +InvokeAgentRuntimeare added, once per stack (guarded, so N agents don't duplicate grants).@aws-blocks/bb-async-jobdependency); bumps@strands-agents/sdkto^1.7.0; addsbedrock-agentcore+@aws-sdk/client-bedrock-agentcore.Validation
build + bb-agent tests (78 unit + 3 CDK synth incl. multi-agent grant-dedup) + conditional-export parity +
lint:depspass. Validated on a real AWS sandbox (us-west-2): all 7 AgentCore runtimes deploy; the full Agent BB e2e suite passes — including tool-uses-another-BB and per-call-context (which failed withAccessDeniedbefore the shared-role design), long-running >29s, and HITL interrupt/resume.API.md+DESIGN.mdupdated. Changeset (minor).Deployment note: changes the deployed infra shape (adds an AgentCore Runtime, removes the agent's SQS queue).
Draft for review. Depends on #367 → #366; merge bottom-up.