Skip to content

Commit ffda73b

Browse files
committed
feat: support clear-thinking-20250115 beta feature
1 parent 6b3044c commit ffda73b

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/claude_agent_sdk/types.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
PermissionMode = Literal["default", "acceptEdits", "plan", "bypassPermissions"]
1919

2020
# SDK Beta features - see https://docs.anthropic.com/en/api/beta-headers
21-
SdkBeta = Literal["context-1m-2025-08-07"]
21+
SdkBeta = Literal[
22+
"context-1m-2025-08-07", # Extended 1M context window
23+
"clear-thinking-20250115", # Clear thinking blocks from previous turns to reduce token usage
24+
]
2225

2326
# Agent definitions
2427
SettingSource = Literal["user", "project", "local"]

tests/test_transport.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,21 @@ def test_build_command_with_max_thinking_tokens(self):
158158
assert "--max-thinking-tokens" in cmd
159159
assert "5000" in cmd
160160

161+
def test_build_command_with_betas(self):
162+
"""Test building CLI command with betas option."""
163+
164+
transport = SubprocessCLITransport(
165+
prompt="test",
166+
options=make_options(
167+
betas=["context-1m-2025-08-07", "clear-thinking-20250115"]
168+
),
169+
)
170+
171+
cmd = transport._build_command()
172+
assert "--betas" in cmd
173+
betas_index = cmd.index("--betas")
174+
assert cmd[betas_index + 1] == "context-1m-2025-08-07,clear-thinking-20250115"
175+
161176
def test_build_command_with_add_dirs(self):
162177
"""Test building CLI command with add_dirs option."""
163178
from pathlib import Path

0 commit comments

Comments
 (0)