Commit Graph
5 Commits
Author SHA1 Message Date
RCDandClaude 41b1ad654e feat(config): add oauth-model-alias migration support
Add migration logic for converting oauth-model-mappings to oauth-model-alias
with comprehensive test coverage.

Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
2026-01-29 21:30:09 +07:00
RCD e6e7e6db30 feat(registry): support provider-specific model info lookup
Add InfoByProvider map to ModelRegistration to store provider-specific
ModelInfo, enabling different capabilities for the same model across
providers (e.g., direct API vs OpenRouter).

Changes:
- Add InfoByProvider field to ModelRegistration struct
- Update GetModelInfo to accept provider parameter for provider-specific lookup
- Update LookupModelInfo to accept variadic provider parameter
- Add LookupStaticModelInfo for fallback to static model definitions
- Update ApplyThinking to pass providerKey for registry lookups
- Update all GetModelInfo callers to use new signature
- Remove ensureMaxTokensForThinking test (function moved to thinking package)

Ported from CLIProxyAPI e641fde2
2026-01-20 11:15:39 +07:00
RCD f528639f1c feat(claude): clamp thinking budget to max_tokens constraints
Improve budget normalization in Claude applier to handle edge cases
where budget exceeds or approaches max_tokens limits.

Cherry-picked from 239a2879.
2026-01-20 10:54:29 +07:00
RCD 5dd078ffb3 refactor(claude): move max_tokens constraint enforcement to Apply method
Move ensureMaxTokensForThinking logic from claude_executor to
thinking/provider/claude/apply.go. This centralizes Claude-specific
thinking budget constraints in the thinking package.

Cherry-picked from c421d653.
2026-01-20 10:53:37 +07:00
RCD f030ec3384 feat(thinking): add unified thinking configuration package
Port the internal/thinking package from CLIProxyAPI for unified thinking
configuration processing across all AI providers.

Features:
- Core types: ThinkingConfig, ThinkingMode, ThinkingLevel, SuffixResult
- Suffix parsing: model-name(16384) or model-name(high) syntax
- Validation: auto-conversion between budget/level formats, clamping
- Provider appliers: claude, gemini, antigravity, openai, codex
- Config extraction: extract thinking config from various request formats
- Stripping: remove thinking config for non-supporting models

Registry updates:
- Add UserDefined field to ModelInfo for passthrough behavior
- Add LookupModelInfo function for model capability lookup
2026-01-19 06:36:22 +07:00