feat: add native SAP AI Core support #50
Closed
rodin
wants to merge 12 commits from
feat/aicore-provider into main
pull from: feat/aicore-provider
merge into: :main
:main
:ci/cleanup
:ci-selfreview-gate
:issue-150
:issue-157
:issue-141
:issue-154
:review-bot-dev-loop
:issue-143
:issue-146
:pr-153
:review-bot-issue-130-work
:issue-148
:issue-139
:issue-137
:review-bot-fixes
:review-bot-issue-133
:review-bot-issue-130
:issue-130
:github-support
:issue-123-work
:issue-123
:review-bot-issue-120
:fix/125-readme-cli-example
:issue-125
:issue-124
:issue-120
:feature/github-support
:review-bot-issue-116
:review-bot-issue-115
:review-bot-issue-114
:review-bot-issue-96
:review-bot-issue-107
:review-bot-issue-82
:review-bot-issue-95
:review-bot-issue-92
:review-bot-issue-94
:review-bot-issue-81
:review-bot-issue-91
:review-bot-issue-97
:issue-80-c-file-reader
:issue-80-b-pr-reader
:issue-80-a-client
:review-bot-issue-80
:review-bot-issue-87
:review-bot-issue-79
:review-bot-issue-84
:review-bot-issue-78
:issue-73
:issue-70
:issue-68
:issue-66
:issue-64
:issue-60-remote-personas
:issue-60
:issue-57
:allow-deps
:feat/aicore-provider-v2
:issue-51
:ci/pr-ready-gate
:fix/stale-commit-check
:feat/aicore-provider
:fix/response-body-truncation
:fix/json-repair
:fix/sonnet-reviewer
:fix/consistent-path-escape
:feat/inline-review-comments
:feat/6-update-existing-review
:fix/19-context-overflow
:feat/18-anthropic-api
:fix/url-escaping-and-shadow
:fix/quick-wins
:fix/context-and-encapsulation
:docs/code-review-report
:ci/release-workflow
12
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
44c80c36cf |
fix: use bedrock-2023-05-31 for AI Core Anthropic version
CI / test (pull_request) Successful in 15s
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Successful in 38s
CI / review (gpt-5, security, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 1m11s
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 2m52s
SAP AI Core's Anthropic endpoint uses AWS Bedrock API format, not native Anthropic API. Verified via integration testing: - 2023-06-01: Invalid API version - bedrock-2023-05-31: Works ✓ |
||
|
|
f71f26fcff |
fix: remove anthropic_version from body - AI Core rejects it
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Failing after 17s
CI / review (gpt-5, security, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 1m37s
CI / test (pull_request) Successful in 15s
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 2m2s
|
||
|
|
8da8fca19d |
fix: add omitempty to model field so it's not sent when empty
CI / test (pull_request) Successful in 15s
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 1m25s
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Failing after 16s
CI / review (gpt-5, security, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 2m39s
|
||
|
|
b12df1a636 |
test: update Anthropic test to check anthropic_version instead of model
CI / test (pull_request) Successful in 16s
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Failing after 16s
CI / review (gpt-5, security, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 1m33s
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 1m50s
|
||
|
|
d13e062866 |
fix: omit model field from AI Core Anthropic request
CI / test (pull_request) Failing after 10s
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Has been skipped
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Has been skipped
CI / review (gpt-5, security, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Has been skipped
AI Core deployment URL already specifies the model. Sending model in the body causes 'Extra inputs are not permitted' error. |
||
|
|
b76270c21b |
fix: put anthropic_version in request body, not header
CI / test (pull_request) Successful in 12s
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Failing after 17s
CI / review (gpt-5, security, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 1m50s
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 2m43s
SAP AI Core expects anthropic_version in the JSON body, not as a header. |
||
|
|
b92a968d93 |
fix: add anthropic-version header for AI Core Anthropic endpoint
CI / test (pull_request) Successful in 14s
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Failing after 17s
CI / review (gpt-5, security, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 1m4s
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 1m9s
|
||
|
|
d02c75486e |
ci: switch to native aicore provider, remove HAI proxy dependency
CI / test (pull_request) Successful in 14s
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Failing after 18s
CI / review (gpt-5, security, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 1m10s
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 1m44s
|
||
|
|
34507dd9ff |
fix: propagate LLM timeout to AI Core client
CI / test (pull_request) Successful in 15s
CI / review (/anthropic/v1, anthropic--claude-4.6-sonnet, sonnet, anthropic, SONNET_REVIEW_TOKEN) (pull_request) Successful in 32s
CI / review (/openai/v1, gpt-5, security, openai, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 1m58s
CI / review (/openai/v1, gpt-5, gpt, openai, GPT_REVIEW_TOKEN) (pull_request) Successful in 2m16s
Address review feedback: MAJOR: - AICoreClient now defaults to 5min timeout (matching Client) - Add AICoreClient.WithTimeout() for explicit timeout control - Client.WithAICore() inherits parent client's timeout - Client.WithTimeout() propagates to aicore client if set MINOR: - Extract AICoreOpenAIAPIVersion constant for the hardcoded api-version - Tighten IsAnthropicModel to only match 'anthropic--' prefix (SAP AI Core always uses this prefix for Anthropic models) NIT: - Use fmt.Sprintf for token generation in tests (robust for >9 calls) - Add error checking in TestAICoreClient_TokenExpiry - Add tests for WithTimeout propagation |
||
|
|
a62b791b9e |
ci: use SAP AI Core model names and remove unavailable models
CI / test (pull_request) Successful in 15s
CI / review (/anthropic/v1, anthropic--claude-4.6-sonnet, sonnet, anthropic, SONNET_REVIEW_TOKEN) (pull_request) Successful in 34s
CI / review (/openai/v1, gpt-5, security, openai, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 2m10s
CI / review (/openai/v1, gpt-5, gpt, openai, GPT_REVIEW_TOKEN) (pull_request) Successful in 2m21s
- Use 'anthropic--claude-4.6-sonnet' instead of 'claude-sonnet-4-6' (hai-aicore proxy requires the 'anthropic--' prefix) - Remove gpt-4.1, gpt-4.1-mini, gpt-5-mini reviewers since those models are not deployed in SAP AI Core - Keep sonnet, gpt-5, and security reviews |
||
|
|
c3ec44a87b |
chore: retrigger CI after LLM_BASE_URL fix
CI / test (pull_request) Successful in 14s
CI / review (/openai/v1, gpt-4.1-mini, gpt41-mini, openai, GPT_REVIEW_TOKEN) (pull_request) Failing after 16s
CI / review (/anthropic/v1, claude-sonnet-4-6, sonnet, anthropic, SONNET_REVIEW_TOKEN) (pull_request) Failing after 17s
CI / review (/openai/v1, gpt-4.1, gpt41, openai, GPT_REVIEW_TOKEN) (pull_request) Failing after 16s
CI / review (/openai/v1, gpt-5-mini, gpt5-mini, openai, GPT_REVIEW_TOKEN) (pull_request) Failing after 13s
CI / review (/openai/v1, gpt-5, security, openai, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 1m17s
CI / review (/openai/v1, gpt-5, gpt, openai, GPT_REVIEW_TOKEN) (pull_request) Successful in 2m2s
|
||
|
|
cf453504cb |
feat: add native SAP AI Core support
CI / test (pull_request) Successful in 13s
CI / review (/anthropic/v1, claude-sonnet-4-6, sonnet, anthropic, SONNET_REVIEW_TOKEN) (pull_request) Failing after 12s
CI / review (/openai/v1, gpt-4.1, gpt41, openai, GPT_REVIEW_TOKEN) (pull_request) Failing after 12s
CI / review (/openai/v1, gpt-4.1-mini, gpt41-mini, openai, GPT_REVIEW_TOKEN) (pull_request) Failing after 14s
CI / review (/openai/v1, gpt-5-mini, gpt5-mini, openai, GPT_REVIEW_TOKEN) (pull_request) Failing after 11s
CI / review (/openai/v1, gpt-5, security, openai, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 1m12s
CI / review (/openai/v1, gpt-5, gpt, openai, GPT_REVIEW_TOKEN) (pull_request) Successful in 1m28s
Adds a new 'aicore' LLM provider that authenticates directly with SAP AI Core
using OAuth client credentials. This eliminates the need for an external proxy
(hai-aicore or hai) when running review-bot in SAP environments.
Key changes:
- New llm/aicore.go with AICoreClient for OAuth token management and
deployment discovery
- Thread-safe token caching with automatic refresh before expiry
- Automatic routing to /invoke (Anthropic) or /chat/completions (OpenAI)
based on model name
- New CLI flags: --aicore-client-id, --aicore-client-secret, --aicore-auth-url,
--aicore-api-url, --aicore-resource-group
- Updated action.yml with corresponding inputs
- Comprehensive test coverage for AI Core client
Example usage in CI:
llm-provider: aicore
llm-model: anthropic--claude-4.6-sonnet
aicore-client-id: ${{ secrets.AICORE_CLIENT_ID }}
aicore-client-secret: ${{ secrets.AICORE_CLIENT_SECRET }}
aicore-auth-url: ${{ secrets.AICORE_AUTH_URL }}
aicore-api-url: ${{ secrets.AICORE_API_URL }}
Closes #49
|