Repository navigation
feat: port Python SDK v0.1.44 features, docs, CI - #1
Merged
Merged
Conversation
Port missing features from the Python claude-agent-sdk to bring the Rust SDK to parity: - Add ClaudeAgentOptions fields: thinking, effort, max_budget_usd, output_format, fallback_model, betas, tools, plugins, sandbox, enable_file_checkpointing, user - Add new types: ThinkingConfig, Effort, ToolsOption, ToolsPreset, SandboxSettings, SdkPluginConfig - Add hook events: PostToolUseFailure, Notification, SubagentStart, PermissionRequest with corresponding input/output structs - Add ResultMessage.structured_output, UserMessage.uuid/tool_use_result, AssistantMessage.error fields - Add RewindFiles and McpStatus control request subtypes - Build all new CLI args in subprocess transport (--effort, --max-thinking-tokens, --json-schema, --max-budget-usd, etc.) - Add rewind_files() and get_mcp_status() to client and query handle - Refactor one-shot query() to use streaming mode internally - Add forward-compatible message parsing (skip unknown message types) - Add new_features example demonstrating thinking, effort, budget, structured output, and MCP status
Add documentation for features ported from Python SDK: - Important Notes section in README (structured output needs >1 turn, budget is a soft cap) - Thinking/Effort, Structured Output, Budget, Fallback Model sections - Updated API guide with new config options, hook events, ResultMessage fields, and full examples
Fix GitHub Issues URL to point to Wally869/claude-agent-sdk-rust. Add doc comments to all pub mod declarations in types/mod.rs. Add module-level doc to types/usage.rs.
Doc examples were missing Box::pin() before calling .next() on streams, causing compilation failures in doc tests. Also add drop() before disconnect to satisfy borrow checker.
Runs on push to main and PRs. Three jobs: - Unit tests + doc tests - Clippy with -D warnings - cargo fmt --check
The hook_callbacks and can_use_tool_callback fields were stored in QueryHandle but never read — the background task already holds its own Arc clones. Removes the dead_code warning.
- Bump version to 1.0.0 for stable release - Update Rust edition from 2021 to 2024 - Add GitHub Actions workflow to publish to crates.io on release (requires CARGO_REGISTRY_TOKEN secret)
Clippy fixes: - Collapse nested ifs using let-chains (edition 2024) - Use or_default() instead of or_insert_with(Default::new) - Box SyncHookOutput in HookOutput::Sync to fix large_enum_variant - Add PendingResponses type alias for type_complexity - Minor style fixes in examples and tests README updates: - Update CLI install to native installer (recommended) - Update prerequisites (Rust 1.85+, no Node.js required) - Update dependency version to 1.x
Use native installer, fix version requirement to 2.0.0+, update auth instructions, fix Claude Code docs URL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
query()to use streaming mode internally (matching Python/TypeScript SDK)Test plan
cargo check— zero warningscargo test --lib— 10 unit tests passcargo test --doc— 20 doc tests passcargo package— packages successfully🤖 Generated with Claude Code