Skip to content

chore: pass bedrock_client with UNSIGNED to prevent IMDS timeout from langchain_aws#693

Merged
cosmin-staicu merged 1 commit intomainfrom
fix/bedrock_client
Mar 14, 2026
Merged

chore: pass bedrock_client with UNSIGNED to prevent IMDS timeout from langchain_aws#693
cosmin-staicu merged 1 commit intomainfrom
fix/bedrock_client

Conversation

@cosmin-staicu
Copy link
Member

  • PR chore: use botocore.UNSIGNED to prevent IMDS timeout in bedrock #692 fixed the bedrock-runtime client IMDS timeout, but langchain_aws's ChatBedrockConverse.validate_environment() creates its own bedrock control plane client when
    bedrock_client is not passed, triggering the same credential chain walk and ~2s IMDS timeout
  • Added get_bedrock_client() using botocore.UNSIGNED and pass it as bedrock_client kwarg in both UiPathChatBedrockConverse and UiPathChatBedrock constructors
  • Moved total_max_attempts: 1 and read_timeout=300 to only apply to the bedrock-runtime client; the bedrock control plane client uses default retry/timeout behavior
  • Extracted _build_session() and _unsigned_config() helpers to share session and config logic between both clients

@cosmin-staicu cosmin-staicu self-assigned this Mar 14, 2026
@cosmin-staicu cosmin-staicu enabled auto-merge (squash) March 14, 2026 15:55
@cosmin-staicu cosmin-staicu merged commit 899a056 into main Mar 14, 2026
39 checks passed
@cosmin-staicu cosmin-staicu deleted the fix/bedrock_client branch March 14, 2026 15:56
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.

2 participants