Commit 6617b9e
authored
fix: pass --thinking flag for adaptive/disabled instead of budget tokens (#796)
## Summary
`thinking={"type":"adaptive"}` was being lowered to
`--max-thinking-tokens 32000`, which puts the CLI into fixed-budget mode
rather than adaptive mode. `disabled` similarly mapped to
`--max-thinking-tokens 0`.
The CLI exposes an explicit `--thinking <adaptive|enabled|disabled>`
flag that takes precedence over `--max-thinking-tokens`. The TypeScript
SDK already uses it. This change mirrors that behavior:
- `adaptive` → `--thinking adaptive`
- `disabled` → `--thinking disabled`
- `enabled` → `--max-thinking-tokens <budget_tokens>`
- deprecated `max_thinking_tokens` is only emitted when `thinking` is
unset
## Test plan
- `pytest tests/test_transport.py` (59 passed)
- New parametrized test for all three `thinking` types
- New precedence test: `thinking` overrides `max_thinking_tokens`1 parent 841ee87 commit 6617b9e
File tree
2 files changed
+46
-8
lines changed- src/claude_agent_sdk/_internal/transport
- tests
2 files changed
+46
-8
lines changedLines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
| 303 | + | |
304 | 304 | | |
305 | | - | |
306 | 305 | | |
307 | 306 | | |
308 | 307 | | |
309 | | - | |
310 | | - | |
| 308 | + | |
311 | 309 | | |
312 | | - | |
| 310 | + | |
313 | 311 | | |
314 | | - | |
315 | | - | |
316 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
236 | 274 | | |
237 | 275 | | |
238 | 276 | | |
| |||
0 commit comments