Commit eeff81f
authored
transport: drop --debug-to-stderr detection (prep for CLI flag removal) (#860)
The CLI's `--debug-to-stderr` flag is being removed in favor of
`--debug-file` (TS SDK already migrated in
anthropics/claude-cli-internal#30630).
**Unlike the TS SDK, this SDK never set `--debug-to-stderr` internally**
— it only *detected* whether users passed it via `extra_args`, to decide
whether to pipe stderr and feed the deprecated `debug_stderr` file
object. So there is no internal flag-send to switch to `--debug-file`.
This PR:
- Pipes stderr based solely on whether a `stderr` callback is registered
(drops the `"debug-to-stderr" in extra_args` checks).
- Removes the deprecated `debug_stderr` write path (already deprecated;
now unreachable). The field stays on `ClaudeAgentOptions` for source
compat but is no longer read by the transport.
- Updates `examples/stderr_callback_example.py` to not pass
`debug-to-stderr`; points users at `extra_args={"debug-file": "/path"}`
for verbose CLI logs.
- Drops the e2e test that asserted on `[DEBUG]` stderr content (depended
on the flag); the no-debug callback test remains.
**Behavior delta:** users who currently pass
`extra_args={"debug-to-stderr": None}` with only `debug_stderr=` (no
`stderr=` callback) will no longer get debug output written to that file
object. Migration: use the `stderr` callback, or pass
`extra_args={"debug-file": "/path"}` and read the file.
Unblocks step 2 (removing `--debug-to-stderr` from the CLI) without
breaking this SDK's example/e2e on the next CLI release.1 parent d570b8a commit eeff81f
4 files changed
Lines changed: 9 additions & 50 deletions
File tree
- e2e-tests
- examples
- src/claude_agent_sdk
- _internal/transport
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | 8 | | |
34 | 9 | | |
35 | 10 | | |
36 | | - | |
| 11 | + | |
37 | 12 | | |
38 | 13 | | |
39 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
Lines changed: 3 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
| 442 | + | |
| 443 | + | |
450 | 444 | | |
451 | 445 | | |
452 | 446 | | |
| |||
462 | 456 | | |
463 | 457 | | |
464 | 458 | | |
465 | | - | |
| 459 | + | |
466 | 460 | | |
467 | 461 | | |
468 | 462 | | |
| |||
505 | 499 | | |
506 | 500 | | |
507 | 501 | | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | 502 | | |
518 | 503 | | |
519 | 504 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1467 | 1467 | | |
1468 | 1468 | | |
1469 | 1469 | | |
1470 | | - | |
| 1470 | + | |
1471 | 1471 | | |
1472 | 1472 | | |
1473 | 1473 | | |
| |||
0 commit comments