Skip to content

remove: drop support for claude-2 and claude-1 series models - #2853

Merged
Calcium-Ion merged 1 commit into
mainfrom
remove/claude-legacy-models
Feb 5, 2026
Merged

Calcium-Ion merged 1 commit into
mainfrom
remove/claude-legacy-models

Conversation

@Calcium-Ion

@Calcium-Ion Calcium-Ion commented Feb 5, 2026 •

Copy link
Copy Markdown
Member
  • Remove claude-instant-1.2, claude-2, claude-2.0, claude-2.1 from model lists
  • Remove /v1/complete endpoint support (legacy completion API)
  • Remove RequestModeCompletion and related code paths
  • Simplify handler functions by removing requestMode parameter
  • Update all channel adaptors that referenced claude handlers

Summary by CodeRabbit

  • Removed Features

    • Deprecated older Claude models (claude-instant-1.2, claude-2, claude-2.0, claude-2.1) are no longer available.
  • Refactor

    • Simplified Claude response handling architecture by streamlining internal handler logic across all relay channels.

- Remove claude-instant-1.2, claude-2, claude-2.0, claude-2.1 from model lists
- Remove /v1/complete endpoint support (legacy completion API)
- Remove RequestModeCompletion and related code paths
- Simplify handler functions by removing requestMode parameter
- Update all channel adaptors that referenced claude handlers
@coderabbitai

coderabbitai Bot commented Feb 5, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

This PR refactors Claude response handling by removing explicit RequestMode parameter passing from handler functions. The handlers now rely on claudeResponse.Type for determining response behavior. This includes updating all handler signatures, removing RequestMode constants and fields, removing deprecated Claude model entries, and updating all call sites across multiple channel adaptors.

Changes

Cohort / File(s) Summary
Core Claude Handler Refactoring
relay/channel/claude/adaptor.go, relay/channel/claude/relay-claude.go
Removed RequestMode constants, field, and parameter. Simplified handler signatures (ClaudeStreamHandler, ClaudeHandler, StreamResponseClaude2OpenAI, ResponseClaude2OpenAI, FormatClaudeResponseInfo, HandleStreamResponseData, HandleStreamFinalResponse, HandleClaudeResponseData) to rely on claudeResponse.Type for mode-based branching instead of explicit requestMode parameter. Consolidated mode-driven logic into type-based conditional branches.
Channel Adaptor Call-Site Updates
relay/channel/ali/adaptor.go, relay/channel/deepseek/adaptor.go, relay/channel/moonshot/adaptor.go, relay/channel/vertex/adaptor.go, relay/channel/volcengine/adaptor.go, relay/channel/zhipu_4v/adaptor.go
Updated DoResponse method calls to claude.ClaudeStreamHandler and claude.ClaudeHandler to remove the RequestModeMessage parameter, aligning with new handler signatures.
AWS Claude Configuration Cleanup
relay/channel/aws/constants.go, relay/channel/aws/relay-aws.go
Removed deprecated Claude model mappings from awsModelIDMap (claude-instant-1.2, claude-2.0, claude-2.1). Updated claude response handler calls (HandleClaudeResponseData, HandleStreamResponseData, HandleStreamFinalResponse) to remove requestMode argument.
Model and Pricing Configuration
relay/channel/claude/constants.go, setting/ratio_setting/model_ratio.go
Removed deprecated Claude model entries (claude-instant-1.2, claude-2.0, claude-2.1) from ModelList and default model ratio map. Removed hardcoded completion ratio logic for these models.
Frontend UI Updates
web/src/helpers/render.jsx
Removed Claude-2.1 predefined color mapping entry; the model will now use hash-based color fallback logic.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~28 minutes

Possibly related PRs

Suggested reviewers

  • seefs001

Poem

🐰 Hop along, dear modes be gone!
Type-based branching carries on—
RequestMode removed with care,
Handlers lighter, simpler, rare!
Claude now whispers, clean and clear! 🌙

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main objective of the pull request: removing support for legacy Claude models (claude-2 and claude-1 series), which is the primary change across all modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch remove/claude-legacy-models

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Calcium-Ion
Calcium-Ion merged commit c540033 into main Feb 5, 2026
@Calcium-Ion
Calcium-Ion deleted the remove/claude-legacy-models branch February 22, 2026 07:57
ennnnny pushed a commit to ennnnny/new-api that referenced this pull request Mar 17, 2026
…gacy-models

remove: drop support for claude-2 and claude-1 series models
salem-2007 added a commit to salem-2007/new-api that referenced this pull request Sep 10, 2026
…gacy-models

remove: drop support for claude-2 and claude-1 series models
junjundesk pushed a commit to junjundesk/new-api that referenced this pull request Oct 3, 2026
…gacy-models

remove: drop support for claude-2 and claude-1 series models
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