Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion ccproxy/llms/models/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,16 @@ class ThinkingConfigDisabled(ThinkingConfigBase):
type: Literal["disabled"] = Field(default="disabled", alias="type")


class ThinkingConfigAdaptive(ThinkingConfigBase):
"""Configuration for adaptive thinking (Claude 4-6+)."""

type: Literal["adaptive"] = Field(default="adaptive", alias="type")
display: Literal["summarized", "omitted"] | None = None


ThinkingConfig = Annotated[
ThinkingConfigEnabled | ThinkingConfigDisabled, Field(discriminator="type")
ThinkingConfigEnabled | ThinkingConfigDisabled | ThinkingConfigAdaptive,
Field(discriminator="type"),
]


Expand Down
9 changes: 4 additions & 5 deletions ccproxy/plugins/claude_api/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,14 @@ async def prepare_provider_request(
# Always set Authorization from OAuth-managed access token
filtered_headers["authorization"] = f"Bearer {token_value}"

# PATCH: Add Computer Use beta headers for Anthropic API
# These are required for browser automation tools to work
# Minimal beta tags required for OAuth-based Claude Code auth
filtered_headers["anthropic-version"] = "2023-06-01"
filtered_headers["anthropic-beta"] = "computer-use-2025-01-24"
filtered_headers["anthropic-beta"] = "claude-code-20250219,oauth-2025-04-20"

# Add CLI headers if available, but never allow overriding auth
# Add CLI headers if available, but never allow overriding auth or beta
cli_headers = self._collect_cli_headers()
if cli_headers:
blocked_overrides = {"authorization", "x-api-key"}
blocked_overrides = {"authorization", "x-api-key", "anthropic-beta"}
for key, value in cli_headers.items():
lk = key.lower()
if lk in blocked_overrides:
Expand Down
Loading