fix: preserve Bedrock DeepSeek model ids - #34441
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate FoundPR #18948: fix(provider): prevent Bedrock from prefixing ARN and deepseek.v3.2 model IDs This appears to be directly related to the current PR #34441. Both PRs address the same issue of preserving Bedrock DeepSeek model IDs (preventing prefixing/normalization that shouldn't happen). You should check if PR #18948 was previously closed or if this is addressing a regression or incomplete fix. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
Updated after rechecking the Bedrock DeepSeek R1 profile behavior. This PR now preserves the intended split:
This is related to #18948, but this PR also covers the current Verified locally:
Known unrelated local blockers while testing broader gates:
|
Robin1987China
left a comment
There was a problem hiding this comment.
LGTM. The narrowing from "deepseek" to "deepseek.r1" correctly distinguishes cross-region inference profiles (R1) from on-demand models (V3.2). The arn: guard is a solid defensive addition — foundation-model ARNs should never be region-prefixed.
One non-blocking note: if Bedrock adds DeepSeek R2 models that also require cross-region profiles, the requiresPrefix list will need updating. The narrow match is the safer choice for now.
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
|
Can this be re-opened and merged? It was already reviewed, but now closed. It is still a problem if you are stuck with AWS and need to use bedrock. |
Upstream v1.18.29 (1674747, merged at 18a4845) -> v1.18.30 (3104c14), 28 commits / 105 files. Staged delta vs pre-merge fork HEAD is identical to the upstream tag-to-tag diff (105 files, +1676/-403), confirming a clean adoption. Functional changes: - feat(opencode): port Astra system prompt from v2 (anomalyco#48057) — new session/prompt/gpt-astra.txt wired through system.ts; fork's system transforms live in the openchamber plugin, no overlap. - fix: preserve Bedrock DeepSeek model ids (anomalyco#34441) — provider.ts Bedrock loader passes arn: model ids through unmodified and tightens the cross-region prefix match from "deepseek" to "deepseek.r1"; inside the custom Azure/Bedrock loader region, disjoint from the fork snapshot architecture. - fix(provider): preserve explicit OpenAI service tiers (anomalyco#47671). - fix(opencode): add GitLab reasoning variants (anomalyco#47306) — transform.ts reasoningEffort now routes gitlab gpt-family to reasoningEffort and claude-family to adaptive thinking; disjoint from the fork GLM/ZhiPu normalization block, which remains intact (+77 fork-only lines). - SDK bumps: @ai-sdk/openai 3.0.88, @ai-sdk/azure 3.0.93, gitlab-ai-provider 6.15.0 (8 packages installed via bun install). - console: oauth client metadata document (anomalyco#47737), Chatwoot enterprise form (anomalyco#47488), openai usage normalization + tier threshold (anomalyco#47342), localized refund FAQs, zen model table updates (muse spark); go.mdx client session compatibility docs incl. zh translation. Conflicts resolved: 29 package.json version bumps (rebranded 1.18.30-sscity with a version-generic pattern after the v1.18.27 incident), bun.lock (took upstream, rebranded workspace entries via bun install). Fork deltas verified intact vs v1.18.30: ProviderSnapshot architecture (+492 in provider.ts), deferred snapshot init, GLM normalization (+77 in transform.ts), config getFresh/commitFresh (+14). Tests: provider, transform, bedrock, config, v2, azure plugin, session retry/llm — 1058 pass / 0 fail across 15 files (22 new upstream tests included); typecheck clean. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Issue for this PR
Closes #34412
Related #18812
Type of change
What does this PR do?
Bedrock DeepSeek model IDs were being treated like generic cross-region model IDs. That changed
deepseek.v3.2intous.deepseek.v3.2, which Bedrock rejects for the on-demand model.This PR keeps explicit Bedrock model identifiers intact:
deepseek.v3.2staysdeepseek.v3.2arn:aws:bedrock:...:foundation-model/...stays unchangedus.deepseek.r1-v1:0still pass through unchangedHow did you verify your code works?
Tested:
cd packages/opencode && bun test test/provider/amazon-bedrock.test.tscd packages/core && bun typecheckgit diff --checkReviewer can confirm by configuring
amazon-bedrock/deepseek.v3.2and checking that the provider receivesdeepseek.v3.2, notus.deepseek.v3.2.Local note:
cd packages/core && bun test test/plugin/provider-amazon-bedrock.test.tscurrently fails before this PR assertions withCannot access 'AmazonBedrockPlugin' before initialization.Screenshots / recordings
N/A, provider behavior only.
Checklist
If you do not follow this template your PR will be automatically rejected.