Skip to content

feat: port Python SDK v0.1.44 features, docs, CI - #1

Merged
Wally869 merged 13 commits into
mainfrom
feat/port-python-sdk-changes
Mar 3, 2026
Merged

Wally869 merged 13 commits into
mainfrom
feat/port-python-sdk-changes

Conversation

@Wally869

@Wally869 Wally869 commented Mar 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Port all missing features from Python claude-agent-sdk v0.1.44 (thinking, effort, structured output, budget limits, fallback model, sandbox, plugins, new hook events, control requests)
  • Refactor one-shot query() to use streaming mode internally (matching Python/TypeScript SDK)
  • Add forward-compatible message parsing (skip unknown message types)
  • Fix all doc test compilation errors (Box::pin, drop before disconnect)
  • Remove dead code warnings
  • Add new feature documentation to README and API guide
  • Add CI workflow (tests, clippy, fmt) and crates.io publish workflow
  • Bump to 1.0.0, edition 2024

Test plan

  • cargo check — zero warnings
  • cargo test --lib — 10 unit tests pass
  • cargo test --doc — 20 doc tests pass
  • cargo package — packages successfully
  • Manual e2e: basic, interactive, new_features examples all run correctly
  • Verified: thinking, effort, budget, structured output, MCP status all work

🤖 Generated with Claude Code

Wally869 added 13 commits March 3, 2026 17:26
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.
@Wally869
Wally869 merged commit 162bbfb into main Mar 3, 2026
3 checks passed
@Wally869
Wally869 deleted the feat/port-python-sdk-changes branch March 3, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant