Skip to content

fix(clients): expose WaitConfig and accept region_name aliases - #675

Merged
jariy17 merged 2 commits into
mainfrom
fix/public-wait-config-region-name
Sep 23, 2026
Merged

jariy17 merged 2 commits into
mainfrom
fix/public-wait-config-region-name

Conversation

@jariy17

@jariy17 jariy17 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

AgentCoreRuntimeClient accepts wait_config but users cannot import WaitConfig from its public package, and passing the region_name keyword used by other SDK clients raises TypeError.

Export WaitConfig from runtime, evaluation, gateway, knowledge_base, and policy, so callers can import it alongside the clients that accept it. Add region_name aliases to AgentCoreRuntimeClient and BatchEvaluationRunner, preserving all existing positional arguments and region selection: explicit region, then region_name, then the existing session/default fallback. Includes batch-runner precedence/compatibility tests and usage documentation.

Related to #663 (WaitConfig imports and region naming). Batch insights remain a separate discussion.

Validation:

  • Remaining runtime and batch-runner tests: 85 passed.
  • All pre-commit checks and the Bandit security scan passed.
  • Built wheel checked in a clean Python 3.12 environment with base dependencies only; all five public imports and real boto3 client region selection passed without service calls.
  • Verified a clean merge with the span-helper changes in fix(evaluation): expose shared span helpers and evaluator level lookup #674 and exercised the combined evaluation/runtime changes.

The initial full run hit an intermittent failure in the unchanged payment retry test's global time.sleep mock. All seven payment retry tests passed in isolation, and the full rerun passed. An unchanged-main comparison separately hit a memory timeout test's global time.time mock exhaustion; these unrelated tests were not changed here.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Breaking Change Warning

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

�[1msrc/bedrock_agentcore/runtime/agent_core_runtime_client.py�[0m:90: AgentCoreRuntimeClient.region: �[33mAttribute value was changed�[39m: validate_region(region or session.region_name if session else None or 'us-west-2') -> validate_region(region or region_name or session.region_name if session else None 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.

@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 22, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 22, 2026
@github-actions github-actions Bot added size/s PR size: S and removed size/m PR size: M labels Sep 22, 2026
@jariy17
jariy17 deployed to auto-approve September 22, 2026 20:27 — with GitHub Actions Active
@jariy17
jariy17 deployed to auto-approve September 22, 2026 20:27 — with GitHub Actions Active
@jariy17
jariy17 deployed to auto-approve September 22, 2026 20:27 — with GitHub Actions Active
@jariy17
jariy17 deployed to auto-approve September 22, 2026 20:27 — with GitHub Actions Active
@jariy17
jariy17 deployed to auto-approve September 22, 2026 20:27 — with GitHub Actions Active
@jariy17
jariy17 deployed to auto-approve September 22, 2026 20:27 — with GitHub Actions Active
@jariy17
jariy17 deployed to auto-approve September 22, 2026 20:27 — with GitHub Actions Active
@jariy17
jariy17 deployed to auto-approve September 22, 2026 20:27 — with GitHub Actions Active
@jariy17
jariy17 deployed to auto-approve September 22, 2026 20:27 — with GitHub Actions Active
@github-actions github-actions Bot removed the size/s PR size: S label Sep 22, 2026
@github-actions github-actions Bot added the size/s PR size: S label Sep 22, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Sep 22, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 22, 2026
@jariy17

jariy17 commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

CI note: the red Compat (evaluation) check is pre-existing and unrelated to this change. I'll address it in a follow-up PR.

The compat job installs pytest plugins only, so v1.23.1's tests_integ/evaluation/test_third_party_adapters.py errors at setup with ModuleNotFoundError: No module named 'ragas' / 'deepeval' (16 collection errors). The same failure occurs on unrelated branches, and the job is continue-on-error: true, so the workflow run itself reports success.

Same follow-up will cover the intermittent test_zero_delay_skips_sleep failure seen on this branch's first run: ragas starts a daemon thread at import time that loops on time.sleep(1), and our tests patch sleep through a module's own time reference — which is the shared stdlib module — so that thread's wake-ups land on the mock and inflate its call count.

@jariy17
jariy17 merged commit e9dcd40 into main Sep 23, 2026
45 of 46 checks passed
michaelnchin pushed a commit to langchain-ai/langchain-aws that referenced this pull request Oct 12, 2026
…he evaluation sample (#1320)

Updates the Deep Agents evaluation sample for `bedrock-agentcore` 1.24
and current deepagents.

**SDK adoption**
- `helpers/agentcore_evals.py` uses
`bedrock_agentcore.evaluation.spans.is_tool_span` in place of its own
copy of the same check, added in
[aws/bedrock-agentcore-sdk-python#674](aws/bedrock-agentcore-sdk-python#674).
- `helpers/agentcore_deploy.py` takes `wait_minutes` again through the
now public `WaitConfig`
([#675](aws/bedrock-agentcore-sdk-python#675)),
since a first create of a large package can exceed the 5 minute default.
- `requirements.txt` pins `bedrock-agentcore>=1.24.0`, the first release
with both.

**Reliability on current deepagents**
- Browser tools get a 60 s deadline and each research subagent 300 s,
through a small `ToolGuardMiddleware`. Playwright's `page.content()`
takes no timeout, so a stuck read could hold a whole run. A missed
deadline resets that researcher's browser and returns an error
`ToolMessage` (tool errors are returned the same way), following the
[fault
tolerance](https://docs.langchain.com/oss/python/deepagents/fault-tolerance)
guidance that recoverable errors go back to the model.
- `recursion_limit` raised from 60 to 150 as a guard.

**Testing**
- Fixture checks and a live deploy using only the released SDK from
`requirements.txt` (1.24.1).
- Fault injection with real AgentCore Browser and Bedrock: with the
first `page.content()` forced to hang, the run recovered and completed
with all 9 metrics correct; the same injection without the deadline was
still hung at 180 s.
- Three parallel invocations on AgentCore Runtime with deepagents
0.7.23: all completed in about 100 s.

This was written with AI assistance. I reviewed the changes and ran the
tests above.

---------

Co-authored-by: Sundar Raghavan <sdraghav@amazon.com>

This branch was successfully deployed

1 active deployment
auto-approve — 52b69986 Deployed Sep 22, 2026 by jariy17 via Test (runtime) #1594
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants