Skip to content

feat: add runtimeClient passthrough support#413

Open
nborges-aws wants to merge 1 commit intomainfrom
feat/runtime-passthrough
Open

feat: add runtimeClient passthrough support#413
nborges-aws wants to merge 1 commit intomainfrom
feat/runtime-passthrough

Conversation

@nborges-aws
Copy link
Copy Markdown

@nborges-aws nborges-aws commented Apr 13, 2026

Issue #: #391

Summary:
Previously, there was no way for customers to programmatically manage agent runtime resources (create, update, delete runtimes/endpoints) through the SDK. This PR adds passthrough plumbing, so allowlisted bedrock-agentcore-control and bedrock-agentcore methods are callable directly on AgentCoreRuntimeClient with snake_case kwarg support. This follows the same pattern established in MemoryClient.

Description of changes:

  • Add getattr passthrough with accept_snake_case_kwargs to AgentCoreRuntimeClient, enabling direct access to allowlisted boto3 control plane and data plane methods
  • Create underlying cp_client (bedrock-agentcore-control) and dp_client (bedrock-agentcore) boto3 clients in init
  • Added utility methods for create and wait, teardown, and aggregated status
  • Control plane allowlisted methods:
    • create_agent_runtime
    • update_agent_runtime
    • get_agent_runtime
    • get_agent_runtime_endpoint
    • delete_agent_runtime
    • delete_agent_runtime_endpoint
  • Data plane allowlisted methods:
    • invoke_agent_runtime
    • stop_runtime_session

Test plan

  • - test_init_default_region — session region used when no explicit region
  • - test_init_default_region_fallback — falls back to us-west-2
  • - test_init_creates_boto3_clients — verifies both CP and DP clients created
  • - test_init_with_integration_source — verifies param stored
  • - test_cp_method_forwarded — CP method forwards to cp_client
  • - test_dp_method_forwarded — DP method forwards to dp_client
  • - test_snake_case_kwargs_converted — agent_runtime_id → agentRuntimeId
  • - test_non_allowlisted_method_raises_attribute_error — unknown method → AttributeError
  • - test_all_cp_methods_in_allowlist / test_all_dp_methods_in_allowlist — assert exact allowlist contents
  • - All existing tests pass (44/44)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

⚠️ Breaking Change Warning

Found 1 potential breaking change(s) in this PR:

�[1msrc/bedrock_agentcore/runtime/agent_core_runtime_client.py�[0m:71: AgentCoreRuntimeClient.region: �[33mAttribute value was changed�[39m: region -> region or session.region_name or 'us-west-2'


Note: This is an automated static analysis check. Some flagged changes may be intentional.
Please confirm each item is expected and, if so, add a migration note to CHANGELOG.md.

region (str): The AWS region to use for the AgentCore Runtime service.
session (Optional[boto3.Session]): Optional boto3 session. If not provided,
a new session will be created using default credentials.
region: AWS region name. If not provided, uses the session's region or "us-west-2".
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I feel like we shouldn't default region, but I know this is against the existing pattern. @jariy17 what do you think?

}

_ALLOWED_CP_METHODS = {
"create_agent_runtime",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

q: how long does a runtime take to be ready? I know memory takes like 3 minutes so we have a create_and_wait utility. Wondering if the same could be useful here. Could come as a follow-up.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yep I had the same thought. Added utilities for wait on create

Copy link
Copy Markdown
Contributor

@tejaskash tejaskash left a comment

Choose a reason for hiding this comment

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

Looks good. Follows the established MemoryClient passthrough pattern cleanly. Good test coverage across polling, timeouts, failure states, and teardown ordering.

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