feat: add Claude Platform on AWS provider (anthropic-aws)#1
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for the anthropic-aws provider (Claude Platform on AWS), allowing users to configure Claude models via AWS environment variables and workspace IDs. It updates the interactive onboarding wizard to prompt for AWS region and workspace ID, adds configuration constants, and includes comprehensive unit tests. Feedback on the changes highlights two key issues: first, a critical bug in the instantiation of ChatAnthropic where configuration options are ignored due to passing modelId as a separate argument; second, a UX issue in the onboarding wizard where completed steps are incorrectly shown as pending because the UI checks process.env instead of the local component state.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| return new ChatAnthropic(modelId, { | ||
| apiKey: process.env[getProviderApiKeyEnvKey(provider)], | ||
| ...(baseURL ? { anthropicApiUrl: baseURL } : {}), | ||
| ...(workspaceId | ||
| ? { | ||
| clientOptions: { | ||
| defaultHeaders: { "anthropic-workspace-id": workspaceId }, | ||
| }, | ||
| } | ||
| : {}), | ||
| ...retryOptions, | ||
| }); |
There was a problem hiding this comment.
The ChatAnthropic constructor from @langchain/anthropic only accepts a single fields configuration object. Passing modelId as the first argument and the configuration options as the second argument means the options object (which contains critical configurations like apiKey, anthropicApiUrl, clientOptions for workspace headers, and maxRetries) is completely ignored by the constructor.
This breaks custom configurations and workspace scoping for both anthropic and anthropic-aws providers. To fix this, pass modelId as the modelName property inside the single configuration object.
return new ChatAnthropic({
modelName: modelId,
apiKey: process.env[getProviderApiKeyEnvKey(provider)],
...(baseURL ? { anthropicApiUrl: baseURL } : {}),
...(workspaceId
? {
clientOptions: {
defaultHeaders: { "anthropic-workspace-id": workspaceId },
},
}
: {}),
...retryOptions,
});| <SetupStep | ||
| label="AWS region" | ||
| state={ | ||
| resolveProviderBaseUrl(provider) | ||
| ? "done" | ||
| : step === "aws-region" | ||
| ? "current" | ||
| : "pending" | ||
| } | ||
| detail={ | ||
| resolveProviderBaseUrl(provider) | ||
| ? "endpoint resolved from region" | ||
| : `save ${AWS_REGION_ENV_KEY} to ${openWikiEnvPath}` | ||
| } | ||
| /> | ||
| <SetupStep | ||
| label="Workspace ID" | ||
| state={ | ||
| process.env[ANTHROPIC_AWS_WORKSPACE_ID_ENV_KEY] | ||
| ? "done" | ||
| : step === "aws-workspace-id" | ||
| ? "current" | ||
| : "pending" | ||
| } | ||
| detail={ | ||
| process.env[ANTHROPIC_AWS_WORKSPACE_ID_ENV_KEY] | ||
| ? "available from environment" | ||
| : `save ${ANTHROPIC_AWS_WORKSPACE_ID_ENV_KEY} to ${openWikiEnvPath}` | ||
| } | ||
| /> |
There was a problem hiding this comment.
During the onboarding wizard, entered values like awsRegion and awsWorkspaceId are only held in the component state and are not written to process.env until the very end of the wizard (when saveCredentialUpdates is called).
Because resolveProviderBaseUrl(provider) and process.env[ANTHROPIC_AWS_WORKSPACE_ID_ENV_KEY] only read from the environment, the UI will incorrectly show these steps as "pending" even after the user has successfully completed them and moved to the next step. Checking the local state variables in addition to the environment resolves this UX issue.
<SetupStep
label="AWS region"
state={
awsRegion || resolveProviderBaseUrl(provider)
? "done"
: step === "aws-region"
? "current"
: "pending"
}
detail={
awsRegion || resolveProviderBaseUrl(provider)
? "endpoint resolved from region"
: `save ${AWS_REGION_ENV_KEY} to ${openWikiEnvPath}`
}
/>
<SetupStep
label="Workspace ID"
state={
awsWorkspaceId || process.env[ANTHROPIC_AWS_WORKSPACE_ID_ENV_KEY]
? "done"
: step === "aws-workspace-id"
? "current"
: "pending"
}
detail={
awsWorkspaceId || process.env[ANTHROPIC_AWS_WORKSPACE_ID_ENV_KEY]
? "available from environment"
: `save ${ANTHROPIC_AWS_WORKSPACE_ID_ENV_KEY} to ${openWikiEnvPath}`
}
/>
openwiki 에 claude on aws 를 사용할 수 있도록 anthropic-aws provider 를 추가했습니다.
공식 openwiki 에도 PR 은 했는데.. 돌아가게만 변경된 너무 대충 구현된 성의없는 변경이라 안받아줄듯..ㅋ
(하고나서 알게 된 건데 별도 프로바이더 추가없이
anthropicprovider 로 지정했을 때CLAUDE_CODE_USE_ANTHROPIC_AWS=1이면AWS_REGION랑ANTHROPIC_AWS_WORKSPACE_ID를 받도록 변경할 걸 그랬습니다..)@JisanBang @doyoonkim-S7C