Skip to content

feat(engine): direct Anthropic/Bedrock provider seam#2

Open
imlach wants to merge 1 commit into
mainfrom
feat/direct-cloud-provider-seam
Open

feat(engine): direct Anthropic/Bedrock provider seam#2
imlach wants to merge 1 commit into
mainfrom
feat/direct-cloud-provider-seam

Conversation

@imlach

@imlach imlach commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds LLM_PROVIDER (ReviewerConfig.llm_provider, default openai-compatible) so an adopter with only an Anthropic API key or AWS credentials can run cora with no LiteLLM/OpenAI-compatible gateway in between — make_review_agent branches on the provider to build a pydantic-ai AnthropicModel / BedrockConverseModel instead of the stock OpenAIChatModel; the default path is byte-identical.
  • Both direct-SDK paths drop non-default sampling parameters and the vLLM enable_thinking extra_body toggle (current Claude models reject one and no-op the other) via a new build_model_settings() helper, and fall back to the provider response's own model_name for the resolved_model check-run chip when there are no x-litellm-* headers to read.
  • New optional extras cora[anthropic] / cora[bedrock]; both imports are lazy, so the default install never requires them.
  • Docs (docs/configuration.md) and CHANGELOG updated.

Test plan

  • pytest -q — 572 passed, 1 skipped (existing 539 untouched + 33 new), on Python 3.11 and the local interpreter, with and without the anthropic/bedrock extras installed
  • ruff check . clean
  • Manual construction smoke test: AgentConfig(provider="anthropic") builds an AnthropicModel pointed at https://api.anthropic.com by default (ignores the localhost:4000 gateway placeholder) and respects an explicit LITELLM_BASE_URL override; AgentConfig(provider="bedrock") builds a BedrockConverseModel with the anthropic. model-ID prefix applied automatically
  • Confirmed ImportError with a pip install 'cora[anthropic|bedrock]' message when the extra isn't installed (simulated via sys.modules injection, and against a clean venv without the extras)

Adds LLM_PROVIDER (ReviewerConfig.llm_provider, default
"openai-compatible") so an adopter with only an Anthropic API key or
AWS credentials can run cora with no LiteLLM/OpenAI-compatible gateway
in between. make_review_agent branches on the provider to build a
pydantic-ai AnthropicModel or BedrockConverseModel instead of the
stock OpenAIChatModel; the default path is untouched.

Both direct-SDK paths drop non-default sampling parameters and the
vLLM enable_thinking extra_body toggle (current Claude models reject
one and no-op the other) via a new build_model_settings() helper, and
fall back to the provider response's own model_name for the
resolved_model check-run chip when no x-litellm-* headers are
present (there's no gateway to emit them).

New optional extras cora[anthropic] / cora[bedrock]; both imports are
lazy so the default install never requires them.
@imlach imlach added review-deep cora: deep agent-loop review and removed review-deep cora: deep agent-loop review labels Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

cora review — skipped

MCP server unreachable

soft-fail by design

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.

1 participant