Conversation
When the main inference provider is `bedrock`, auxiliary tasks (context compression, web summarization, memory flush, session search) fail with `unhandled auth_type aws_sdk` because resolve_provider_client() has no handler for the aws_sdk auth type used by the Bedrock provider. This adds a BedrockAuxiliaryClient wrapper that translates the standard `client.chat.completions.create()` interface to Bedrock's Converse API via the existing `bedrock_adapter.call_converse()`, following the same pattern as CodexAuxiliaryClient and AnthropicAuxiliaryClient. Changes: - Add BedrockAuxiliaryClient / AsyncBedrockAuxiliaryClient wrapper classes - Handle aws_sdk auth_type in resolve_provider_client() with region resolution priority: AWS_DEFAULT_REGION env > explicit base_url > us-east-1 - Register BedrockAuxiliaryClient in _to_async_client() - 18 new tests covering sync/async/resolve/region/fallback paths Fixes the 'No auxiliary LLM provider configured' warning for Bedrock-only deployments (e.g. EC2 instances with IAM instance profiles). Co-Authored-By: Craft Agent <agents-noreply@craft.do>
|
Thanks for the thorough PR, @superyhee — the root cause you identified was real and well-diagnosed. This is an automated hermes-sweeper review. The specific gap you fixed ( Evidence:
One nuance worth noting for follow-up: the landed fix routes through the Anthropic SDK Bedrock path, which means non-Anthropic models hosted on Bedrock (Llama, Mistral, etc.) may still not work for auxiliary tasks. If that's a use-case you care about, a follow-up issue scoped to |
Problem
When the main inference provider is
bedrock, auxiliary tasks (context compression, web summarization, memory flush, session search) fail with:This affects all Bedrock-only deployments (e.g. EC2 instances with IAM instance profiles) where no other LLM provider API key is configured.
Root Cause
resolve_provider_client()handlesapi_key,external_process, andoauth_*auth types, but has no handler for theaws_sdkauth type used by the Bedrock provider inPROVIDER_REGISTRY.Solution
Add a
BedrockAuxiliaryClientwrapper that translates the standardclient.chat.completions.create()interface to Bedrock's Converse API via the existingbedrock_adapter.call_converse(), following the same pattern asCodexAuxiliaryClientandAnthropicAuxiliaryClient.Changes
agent/auxiliary_client.py:BedrockAuxiliaryClient/AsyncBedrockAuxiliaryClientwrapper classes (sync + async, same architecture as Codex/Anthropic wrappers)aws_sdkauth_type inresolve_provider_client()with region resolution priority:AWS_DEFAULT_REGIONenv → explicitbase_url→us-east-1defaultBedrockAuxiliaryClientin_to_async_client()tests/agent/test_bedrock_auxiliary.py(new):Design Decisions
bedrock_adapter.call_converse()— no new Bedrock API code; the adapter already handles OpenAI ↔ Converse format conversionboto3/bedrock_adapteronly imported when actually needed, keeping the module lightweight for non-Bedrock usersPROVIDER_REGISTRYhardcodesinference_base_urltous-east-1, so env var must take priority for cross-region deploymentsTesting
test_auxiliary_client.py+test_bedrock_adapter.pytests pass (zero regressions)