feat: claude platform on aws channel#4957
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (39)
✅ Files skipped from review due to trivial changes (13)
🚧 Files skipped from review as they are similar to previous changes (25)
WalkthroughAdds a new Claude Platform on AWS channel (ID 58) with SigV4 signing support, a dedicated relay adaptor, backend type/constants/DTO updates, UI configuration in classic and default frontends, and localization across multiple locales. ChangesClaude Platform on AWS Channel Support
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.42.2)web/classic/src/components/table/channels/modals/EditChannelModal.jsxThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (2)
web/classic/src/components/table/channels/modals/EditChannelModal.jsx (1)
2731-2793: ⚡ Quick winMissing key format hint when SigV4 authentication is selected.
When
claude_on_aws_auth_typeis'sigv4', users need to enter credentials inAK|SKorAK|SK|SessionTokenformat, but the key input placeholder (line 3168) falls through to the generic message fromtype2secretPrompt. Type 33 (AWS Bedrock) handles this by conditionally setting the placeholder based onaws_key_type.Consider adding type 58 to the conditional placeholder logic in the key input field (around line 3163-3169):
💡 Suggested enhancement
placeholder={ inputs.type === 33 ? inputs.aws_key_type === 'api_key' ? t('请输入 API Key,格式:APIKey|Region') : t( '按照如下格式输入:AccessKey|SecretAccessKey|Region', ) + : inputs.type === 58 + ? inputs.claude_on_aws_auth_type === 'sigv4' + ? t( + '按照如下格式输入:AccessKeyID|SecretAccessKey 或 AK|SK|SessionToken', + ) + : t('请输入 API Key') : t(type2secretPrompt(inputs.type)) }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/classic/src/components/table/channels/modals/EditChannelModal.jsx` around lines 2731 - 2793, The key input's placeholder isn't updated for channel type 58 when users select SigV4; update the logic that computes the placeholder (the same logic that references type2secretPrompt / aws_key_type for type 33) to also handle type 58 by checking inputs.claude_on_aws_auth_type and, when it's 'sigv4', set the placeholder to the AK|SK or AK|SK|SessionToken hint; when it's 'api_key' keep the existing type2secretPrompt/default placeholder. Locate the key input that uses type2secretPrompt (the secret/key field for Claude on AWS) and add the conditional branch based on inputs.claude_on_aws_auth_type (and channel type 58) to return the SigV4-specific placeholder.web/default/src/i18n/locales/en.json (1)
426-426: 🏗️ Heavy liftUse hierarchical i18n keys for the new AWS/Claude strings.
These newly added entries use raw UI text as keys. Please switch them to semantic hierarchical keys (for example,
channels.claudeOnAws.authMethod.label) to comply with project i18n naming rules and keep key naming consistent.As per coding guidelines, use “hierarchical and semantically clear translation key names such as
dashboard.overview.titleand maintain naming consistency”.Also applies to: 470-471, 705-705, 4480-4487
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/default/src/i18n/locales/en.json` at line 426, The i18n file uses raw UI text keys (e.g., "Authentication Method") instead of hierarchical semantic keys; refactor those keys to hierarchical names (for example rename "Authentication Method" → "channels.claudeOnAws.authMethod.label") and apply the same pattern for the other affected entries (lines referenced around 470-471, 705, and 4480-4487) and then update any code that references the old literal keys to use the new keys (search for usages of "Authentication Method" and the other raw keys and replace them with the new hierarchical keys such as channels.claudeOnAws.* to keep naming consistent).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@web/default/src/features/channels/lib/channel-form.ts`:
- Around line 130-133: The claude_on_aws_auth_type default is set to 'api_key'
but should be SigV4; update every initialization/fallback that sets
claude_on_aws_auth_type (e.g., the defaults object where
claude_on_aws_auth_type: 'api_key' appears and any other places that fallback to
'api_key' such as form initializers/serializers referenced around the other
occurrences) to use 'sigv4' (or the canonical string used elsewhere for SigV4)
so new/edited channels default to SigV4; ensure related fields
claude_on_aws_region and claude_on_aws_workspace_id remain unchanged and run a
quick search for all usages of claude_on_aws_auth_type to update any conditional
logic that assumes 'api_key'.
- Around line 68-71: The Zod schema currently leaves claude_on_aws_region and
claude_on_aws_workspace_id optional which allows invalid submissions when the
channel type is Claude-on-AWS (type === 58); update the channel form Zod object
schema that contains claude_on_aws_auth_type, claude_on_aws_region and
claude_on_aws_workspace_id to add a conditional validation (using .refine or
.superRefine on the parent schema) that when type === 58 enforces
claude_on_aws_region and claude_on_aws_workspace_id are present and non-empty
(and optionally validate claude_on_aws_auth_type if you need to constrain auth
types), returning clear field-specific errors for those two fields so the form
cannot submit invalid configs.
In `@web/default/src/i18n/locales/fr.json`:
- Line 426: Replace the English strings left in fr.json with French translations
while keeping the existing translation keys and hierarchy intact: specifically
update the value for "Authentication Method" to "Méthode d'authentification" and
translate the other English values referenced at the ranges (lines ~470, ~471,
~705 and ~4480-~4487) to appropriate French text, preserving naming consistency
and any hierarchical key structure so only the values change and key names
remain unchanged.
In `@web/default/src/i18n/locales/ja.json`:
- Line 426: The ja.json locale contains untranslated English values (e.g., the
key "Authentication Method") which cause mixed-language UI; update the value for
"Authentication Method" and any other English entries in ja.json (including the
groups noted around the other ranges) to their correct Japanese translations,
preserving the JSON keys unchanged and ensuring encoding/escaping remains valid
so the file stays a well-formed JSON locale file.
In `@web/default/src/i18n/locales/ru.json`:
- Line 426: Several new entries in the Russian locale file are left in English
(e.g., the key "Authentication Method" in ru.json and the other untranslated
entries around lines referenced 4480-4487); update those values to proper
Russian translations, preserving the JSON keys and punctuation, ensure the file
remains valid JSON (proper quoting, commas, and UTF-8 encoding), and run a quick
lint/format check to confirm no syntax errors after replacing the English
strings with their Russian equivalents.
In `@web/default/src/i18n/locales/vi.json`:
- Line 426: The Vietnamese locale contains untranslated English entries (for
example the key "Authentication Method" and other newly added keys around lines
noted in the review); update vi.json by replacing these English values with
proper Vietnamese translations for each key (including the entries referenced at
lines ~426, ~470-471, ~705, and ~4480-4487), and ensure the translation keys
follow the repository's naming convention (use hierarchical, semantically clear
keys such as dashboard.overview.title where applicable) so the file remains
consistent and UI strings render fully in Vietnamese.
In `@web/default/src/i18n/locales/zh.json`:
- Line 4480: The zh.json entry for the key "Workspace ID *" is still English;
update the value in the Chinese locale file so the key "Workspace ID *" maps to
an appropriate Chinese translation (e.g., "工作区 ID *") to avoid mixed-language
UI—locate the string "Workspace ID *" in zh.json and replace its value with the
Chinese text.
---
Nitpick comments:
In `@web/classic/src/components/table/channels/modals/EditChannelModal.jsx`:
- Around line 2731-2793: The key input's placeholder isn't updated for channel
type 58 when users select SigV4; update the logic that computes the placeholder
(the same logic that references type2secretPrompt / aws_key_type for type 33) to
also handle type 58 by checking inputs.claude_on_aws_auth_type and, when it's
'sigv4', set the placeholder to the AK|SK or AK|SK|SessionToken hint; when it's
'api_key' keep the existing type2secretPrompt/default placeholder. Locate the
key input that uses type2secretPrompt (the secret/key field for Claude on AWS)
and add the conditional branch based on inputs.claude_on_aws_auth_type (and
channel type 58) to return the SigV4-specific placeholder.
In `@web/default/src/i18n/locales/en.json`:
- Line 426: The i18n file uses raw UI text keys (e.g., "Authentication Method")
instead of hierarchical semantic keys; refactor those keys to hierarchical names
(for example rename "Authentication Method" →
"channels.claudeOnAws.authMethod.label") and apply the same pattern for the
other affected entries (lines referenced around 470-471, 705, and 4480-4487) and
then update any code that references the old literal keys to use the new keys
(search for usages of "Authentication Method" and the other raw keys and replace
them with the new hierarchical keys such as channels.claudeOnAws.* to keep
naming consistent).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1e5b765d-cd51-4eaf-9b23-0f5af0e477cf
📒 Files selected for processing (32)
common/api_type.gocommon/endpoint_type.goconstant/api_type.goconstant/channel.godto/channel_settings.gorelay/channel/claude_platform_on_aws/adaptor.gorelay/channel/claude_platform_on_aws/constants.gorelay/channel/claude_platform_on_aws/sigv4.gorelay/channel/claude_platform_on_aws/sigv4_test.gorelay/common/relay_info.gorelay/relay_adaptor.goweb/classic/src/components/table/channels/modals/EditChannelModal.jsxweb/classic/src/constants/channel.constants.jsweb/classic/src/helpers/render.jsxweb/default/src/features/channels/components/drawers/channel-mutate-drawer.tsxweb/default/src/features/channels/constants.tsweb/default/src/features/channels/lib/channel-form.tsweb/default/src/features/channels/lib/channel-type-config.tsweb/default/src/features/channels/lib/channel-utils.tsweb/default/src/features/channels/types.tsweb/default/src/i18n/locales/_reports/_sync-report.jsonweb/default/src/i18n/locales/_reports/fr.untranslated.jsonweb/default/src/i18n/locales/_reports/ja.untranslated.jsonweb/default/src/i18n/locales/_reports/ru.untranslated.jsonweb/default/src/i18n/locales/_reports/vi.untranslated.jsonweb/default/src/i18n/locales/_reports/zh.untranslated.jsonweb/default/src/i18n/locales/en.jsonweb/default/src/i18n/locales/fr.jsonweb/default/src/i18n/locales/ja.jsonweb/default/src/i18n/locales/ru.jsonweb/default/src/i18n/locales/vi.jsonweb/default/src/i18n/locales/zh.json
…ous#4957 Backend (relay/channel/claude_platform_on_aws/): - Add godoc comments to GetChannelName / GetModelList and the SigV4 helpers hashSHA256Hex / hmacSHA256 / deriveSigningKey. - Add doc comments to TestParseSigV4ApiKey / TestCanonicalQuery. Frontend (web/default/): - Default auth type to sigv4 (matches the backend documented default and AWS's primary recommendation; the previous api_key default could silently create channels with the wrong mode). - Required-field validation for channel type 58: region, workspace_id and auth type must be set. - i18n: complete the zh translation for "Workspace ID *" and sync new keys across fr / ja / ru / vi. Frontend (web/classic/): - Show a SigV4-aware placeholder on the key input when type=58 and auth_type=sigv4 ("AccessKeyID|SecretAccessKey or AK|SK|SessionToken"). - Sync i18n keys across en / fr / ja / ru / vi / zh-CN / zh-TW / zh.
|
Thanks for the thorough review! Pushed 86649e84 addressing the feedback. Backend (
|
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
web/default/src/i18n/locales/fr.json (1)
705-705:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winFinish French localization for remaining Claude-on-AWS labels/help text.
These values still surface mixed English in
fr.json, which creates an inconsistent French UI.🌍 Suggested patch
- "Claude Platform on AWS": "Claude Platform on AWS", + "Claude Platform on AWS": "Plateforme Claude sur AWS", - "API Key mode: paste the key generated in AWS Console → Claude Platform on AWS → API keys": "Mode Clé API : collez la clé générée dans AWS Console → Claude Platform on AWS → API keys", + "API Key mode: paste the key generated in AWS Console → Claude Platform on AWS → API keys": "Mode clé API : collez la clé générée dans la console AWS → Plateforme Claude sur AWS → Clés API", - "Region of the Claude Platform on AWS endpoint, used in URL aws-external-anthropic.{region}.api.aws": "Région du point de terminaison Claude Platform on AWS, utilisée dans l'URL aws-external-anthropic.{region}.api.aws", + "Region of the Claude Platform on AWS endpoint, used in URL aws-external-anthropic.{region}.api.aws": "Région du point de terminaison Plateforme Claude sur AWS, utilisée dans l'URL aws-external-anthropic.{region}.api.aws", - "Required anthropic-workspace-id header. Find it in AWS Console → Claude Platform on AWS → Workspaces.": "En-tête anthropic-workspace-id requis. Trouvez-le dans AWS Console → Claude Platform on AWS → Workspaces.", + "Required anthropic-workspace-id header. Find it in AWS Console → Claude Platform on AWS → Workspaces.": "En-tête anthropic-workspace-id requis. Trouvez-le dans la console AWS → Plateforme Claude sur AWS → Espaces de travail.",As per coding guidelines, "Use hierarchical and semantically clear translation key names such as dashboard.overview.title and maintain naming consistency".
Also applies to: 4482-4482, 4485-4485, 4487-4487
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/default/src/i18n/locales/fr.json` at line 705, Replace the English strings in fr.json with proper French translations for the remaining Claude-on-AWS labels/help text: locate the entry whose key/value is "Claude Platform on AWS" and update the value to the French equivalent (e.g., "Plateforme Claude sur AWS") and do the same for the other remaining English entries referenced in the review (the other Claude-on-AWS labels at the same block). Keep the existing JSON keys intact, only change the values to French, and ensure wording follows the project's hierarchical/semantic translation naming style and tone.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@web/classic/src/components/table/channels/modals/EditChannelModal.jsx`:
- Line 204: The default auth mode for Type 58 is incorrectly set to 'api_key';
update all occurrences that set or fallback to claude_on_aws_auth_type to use
'sigv4' instead (this impacts initialization, loading, saving and UI fallback
paths). Search for the symbol claude_on_aws_auth_type and replace the default
value 'api_key' with 'sigv4' in the EditChannelModal.jsx defaults and any other
places referenced in the diff (including the other reported occurrences at the
same symbol) so new channels pick sigv4 by default and remain backend-aligned.
---
Duplicate comments:
In `@web/default/src/i18n/locales/fr.json`:
- Line 705: Replace the English strings in fr.json with proper French
translations for the remaining Claude-on-AWS labels/help text: locate the entry
whose key/value is "Claude Platform on AWS" and update the value to the French
equivalent (e.g., "Plateforme Claude sur AWS") and do the same for the other
remaining English entries referenced in the review (the other Claude-on-AWS
labels at the same block). Keep the existing JSON keys intact, only change the
values to French, and ensure wording follows the project's hierarchical/semantic
translation naming style and tone.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fb415fd6-1adb-4334-96b3-13857f253e79
📒 Files selected for processing (19)
relay/channel/claude_platform_on_aws/adaptor.gorelay/channel/claude_platform_on_aws/sigv4.gorelay/channel/claude_platform_on_aws/sigv4_test.goweb/classic/src/components/table/channels/modals/EditChannelModal.jsxweb/classic/src/i18n/locales/en.jsonweb/classic/src/i18n/locales/fr.jsonweb/classic/src/i18n/locales/ja.jsonweb/classic/src/i18n/locales/ru.jsonweb/classic/src/i18n/locales/vi.jsonweb/classic/src/i18n/locales/zh-CN.jsonweb/classic/src/i18n/locales/zh-TW.jsonweb/classic/src/i18n/locales/zh.jsonweb/default/src/features/channels/lib/channel-form.tsweb/default/src/i18n/locales/_reports/_sync-report.jsonweb/default/src/i18n/locales/fr.jsonweb/default/src/i18n/locales/ja.jsonweb/default/src/i18n/locales/ru.jsonweb/default/src/i18n/locales/vi.jsonweb/default/src/i18n/locales/zh.json
✅ Files skipped from review due to trivial changes (4)
- web/classic/src/i18n/locales/zh-CN.json
- web/classic/src/i18n/locales/fr.json
- web/classic/src/i18n/locales/ja.json
- web/default/src/i18n/locales/zh.json
🚧 Files skipped from review as they are similar to previous changes (8)
- web/default/src/i18n/locales/_reports/_sync-report.json
- web/default/src/i18n/locales/vi.json
- relay/channel/claude_platform_on_aws/sigv4_test.go
- web/default/src/i18n/locales/ja.json
- web/default/src/features/channels/lib/channel-form.ts
- web/default/src/i18n/locales/ru.json
- relay/channel/claude_platform_on_aws/adaptor.go
- relay/channel/claude_platform_on_aws/sigv4.go
…sh fr i18n - Classic UI: default claude_on_aws_auth_type to 'sigv4' across init, parsed-settings fallback, catch branch, legacy-data fallback, UI Select value, and persist default. Matches the default UI behavior and PR objective; prevents silently selecting api_key for new type 58 channels. - French i18n (web/default): switch to lowercase "console AWS" and localize "API keys" -> "Clés API" / "Workspaces" -> "Espaces de travail" to match existing fr.json conventions (cf. line 351 "Clés API", line 4438 "Espaces de travail"). The product name "Claude Platform on AWS" is intentionally kept untranslated for cross-locale consistency: zh/ja/ru/vi/en all retain the original spelling, in line with AWS documentation conventions for product names. Addresses PR QuantumNous#4957 second-round review feedback.
|
Thanks for the review. Pushed 1. Default auth mode (Major) 2. French localization (Minor) The product name 感谢 review。已通过
|
Add a new channel type for Claude Platform on AWS — Anthropic's
new offering that exposes the native Anthropic Messages API through
AWS IAM auth and AWS Marketplace billing, with same-day access to
new Claude models and beta features (Agent Skills, Code Execution,
Files API, Extended Thinking, Prompt Caching).
Channel type: 58 (ChannelTypeClaudeOnAws)
API type: APITypeClaudeOnAws
The wire protocol is identical to the first-party Anthropic Messages
API. The adapter embeds claude.Adaptor and only overrides the URL,
header and DoRequest paths — every other concern (streaming,
thinking, tool use, prompt caching, response parsing) is reused.
Authentication supports two modes:
- sigv4 (default): AWS Signature Version 4 via IAM credentials
- api_key: Bearer key issued in the AWS Console
SigV4 signing is implemented in-package (no new dependency) and
verified against the AWS official IAM ListUsers test vector.
Each request must carry an anthropic-workspace-id header; the value
is taken from the channel's other_settings, with optional override
via the request header.
Frontend changes:
- default theme: type-58 form fields (auth method / region /
workspace id), Claude icon, full i18n keys
- classic theme: same fields and icon mapping
Tested end-to-end against AWS:
- native /v1/messages (streaming and non-streaming)
- OpenAI /v1/chat/completions via protocol conversion
- extended thinking (explicit and -thinking suffix)
- prompt caching, tool use, code execution beta
- anthropic-beta header passthrough
…ous#4957 Backend (relay/channel/claude_platform_on_aws/): - Add godoc comments to GetChannelName / GetModelList and the SigV4 helpers hashSHA256Hex / hmacSHA256 / deriveSigningKey. - Add doc comments to TestParseSigV4ApiKey / TestCanonicalQuery. Frontend (web/default/): - Default auth type to sigv4 (matches the backend documented default and AWS's primary recommendation; the previous api_key default could silently create channels with the wrong mode). - Required-field validation for channel type 58: region, workspace_id and auth type must be set. - i18n: complete the zh translation for "Workspace ID *" and sync new keys across fr / ja / ru / vi. Frontend (web/classic/): - Show a SigV4-aware placeholder on the key input when type=58 and auth_type=sigv4 ("AccessKeyID|SecretAccessKey or AK|SK|SessionToken"). - Sync i18n keys across en / fr / ja / ru / vi / zh-CN / zh-TW / zh.
…sh fr i18n - Classic UI: default claude_on_aws_auth_type to 'sigv4' across init, parsed-settings fallback, catch branch, legacy-data fallback, UI Select value, and persist default. Matches the default UI behavior and PR objective; prevents silently selecting api_key for new type 58 channels. - French i18n (web/default): switch to lowercase "console AWS" and localize "API keys" -> "Clés API" / "Workspaces" -> "Espaces de travail" to match existing fr.json conventions (cf. line 351 "Clés API", line 4438 "Espaces de travail"). The product name "Claude Platform on AWS" is intentionally kept untranslated for cross-locale consistency: zh/ja/ru/vi/en all retain the original spelling, in line with AWS documentation conventions for product names. Addresses PR QuantumNous#4957 second-round review feedback.
fe72ac6 to
8c2ed6a
Compare
|
Force-pushed to add SSH signatures on all 3 commits — no code changes. The What changed:
Old → new SHA mapping:
Sorry for the noise — happy to squash or restructure further if helpful. 为补齐 commit 签名要求做了一次 force-push,代码内容完全没变,只是给 3 个 commit 加上了 SSH 签名(签名信息写进 commit object,所以 SHA 全变了)。
如需要 squash 或调整 commit 结构,可以再改。 |
Summary
Add a new channel type for Claude Platform on AWS — Anthropic's new offering (GA May 2026) that exposes the native Anthropic Messages API through AWS IAM auth and AWS Marketplace billing, with same-day access to new Claude models and beta features (Agent Skills, Code Execution, Files API, Extended Thinking, Prompt Caching).
This service is distinct from Amazon Bedrock:
/v1/messages(vs Bedrock's/converse)Changes
58(ChannelTypeClaudeOnAws) and api typeAPITypeClaudeOnAwsrelay/channel/claude_platform_on_aws/(4 files): adapter embedsclaude.Adaptor, only overrides URL / header / DoRequest pathsdto.ChannelOtherSettingsadds 3 fields:claude_on_aws_auth_type,claude_on_aws_region,claude_on_aws_workspace_idStats: 32 files changed, +1106 / -34, 0 new dependencies.
Authentication
Two modes, controlled by
claude_on_aws_auth_type:sigv4(default): AWS Signature Version 4 via IAM credentials. The channelkeyfield stores<AccessKeyID>|<SecretAccessKey>or<AK>|<SK>|<SessionToken>(matching the existing AWS Bedrock channel'skey|regionconvention).api_key: Bearer key issued in the AWS Console (under Claude Platform on AWS → API keys). Sent asAuthorization: Bearer <key>.Each request must carry an
anthropic-workspace-idheader; the value is taken from the channel settings, with optional override via the request header (so multiple workspaces can share a single channel).Validation
Unit tests
TestSigV4_AWSReferenceVector— passes against AWS official IAM ListUsers vector (signature5d672d79c15b13162d9279b0855cfba6789a8edb4c82c400e06b5924a6f2b5d7)TestSigV4_ClaudePlatformOnAws_AddsRequiredHeadersTestParseSigV4ApiKey(5 sub-cases)TestCanonicalQueryEnd-to-end against real AWS
Tested with API Key auth mode (Anthropic API key generated in AWS Console):
/api/channel/test/:id)/v1/messages(non-stream)inference_geo,cache_creationetc./v1/messages(SSE streaming)message_start → content_block_delta → message_stop/v1/chat/completionsanthropic-betaheader passthroughthinking.type=enabled)thinking+textcontent blocks-thinkingsuffix shortcut (e.g.claude-sonnet-4-6-thinking)cache_creation_input_tokens=4003, 2nd callcache_read_input_tokens=4003stop_reason=tool_useand tool inputbash_code_execution_tool_result.stdout="6765"for Fibonacci(20)Build / lint
go build ./...— cleango test ./relay/channel/claude_platform_on_aws/...— all passgo veton touched packages — cleangofmt— cleanbun run typecheck(web/default) — cleanbun run build— both themes build successfullyKnown limitations / out of scope
These are not blockers for this PR; they can be follow-ups:
/v1/messagesroute. The upstream/v1/filesand/v1/batchesroutes are currentlyRelayNotImplementedplaceholders project-wide; supporting them is a separate effort./v1/modelsover SigV4 is not implemented.Resources
中文摘要
为 new-api 增加 Claude Platform on AWS 通道(channel type
58)。该服务是 AWS 在 2026 年 5 月 GA 的 Claude 接入新方式,与 Bedrock 并列但相互独立:/converse)设计要点
relay/channel/claude_platform_on_aws/包,通过 Go 嵌入复用claude.Adaptor的协议处理(streaming / thinking / tool use 全部继承),仅覆盖 URL / header / DoRequest 三处差异联调状态
Summary by CodeRabbit
New Features
Localization
Tests