mirror of
https://github.com/anthropics/claude-code-sdk-python.git
synced 2025-12-23 09:19:52 +00:00
feat: add fork_session option for resuming sessions (#179)
Some checks failed
Lint / lint (push) Has been cancelled
Test / test (3.10) (push) Has been cancelled
Test / test (3.11) (push) Has been cancelled
Test / test (3.12) (push) Has been cancelled
Test / test (3.13) (push) Has been cancelled
Test / test-e2e (3.11) (push) Has been cancelled
Test / test-e2e (3.13) (push) Has been cancelled
Test / test-examples (3.10) (push) Has been cancelled
Test / test-examples (3.11) (push) Has been cancelled
Test / test-examples (3.12) (push) Has been cancelled
Test / test-e2e (3.12) (push) Has been cancelled
Test / test-e2e (3.10) (push) Has been cancelled
Test / test-examples (3.13) (push) Has been cancelled
Some checks failed
Lint / lint (push) Has been cancelled
Test / test (3.10) (push) Has been cancelled
Test / test (3.11) (push) Has been cancelled
Test / test (3.12) (push) Has been cancelled
Test / test (3.13) (push) Has been cancelled
Test / test-e2e (3.11) (push) Has been cancelled
Test / test-e2e (3.13) (push) Has been cancelled
Test / test-examples (3.10) (push) Has been cancelled
Test / test-examples (3.11) (push) Has been cancelled
Test / test-examples (3.12) (push) Has been cancelled
Test / test-e2e (3.12) (push) Has been cancelled
Test / test-e2e (3.10) (push) Has been cancelled
Test / test-examples (3.13) (push) Has been cancelled
Add support for fork_session parameter which allows resumed sessions to fork to a new session ID rather than continuing the previous session. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
12fdca9b1b
commit
cfdd28a254
2 changed files with 6 additions and 0 deletions
|
|
@ -153,6 +153,9 @@ class SubprocessCLITransport(Transport):
|
|||
if self._options.include_partial_messages:
|
||||
cmd.append("--include-partial-messages")
|
||||
|
||||
if self._options.fork_session:
|
||||
cmd.append("--fork-session")
|
||||
|
||||
# Add extra args for future CLI flags
|
||||
for flag, value in self._options.extra_args.items():
|
||||
if value is None:
|
||||
|
|
|
|||
|
|
@ -314,6 +314,9 @@ class ClaudeCodeOptions:
|
|||
|
||||
# Partial message streaming support
|
||||
include_partial_messages: bool = False
|
||||
# When true resumed sessions will fork to a new session ID rather than
|
||||
# continuing the previous session.
|
||||
fork_session: bool = False
|
||||
|
||||
|
||||
# SDK Control Protocol
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue