Copilot SDK Rust v1.0.0-beta.9: Error Handling & Tool Hooks

Rust SDK v1.0.0-beta.9 brings error struct refactoring, post-tool-use failure hooks, and per-message agent mode control. Breaking change in error handling requires migration.

Copilot SDK Rust v1.0.0-beta.9: Error Handling & Tool Hooks

TL;DR

  • Rust SDK errors refactored to use structs with kind() method for better error handling
  • Post-tool-use failure hooks added for improved agent control
  • Multitenancy hardening in Client Mode and per-message agent mode fixes

New

  • Post-tool-use failure hooks — Execute custom logic after tool execution fails, giving agents better error recovery paths
  • MessageOptions.agentMode — Set agent mode per-message instead of globally, fixing mode misuse bugs
  • Extract-to-cache build mode — New Copilot CLI build mode for optimized artifact caching
  • Rust error struct refactor — Errors now use structs with kind() method instead of enums, improving type safety and extensibility

Fixed

  • JSON-RPC error data preservation in .NET SDK — Error context now survives serialization
  • Multitenancy hardening in Client Mode — Improved isolation and security for multi-tenant deployments
  • Repackaging issues — Resolved distribution and artifact handling

Breaking Changes

  • Rust SDK error handling — Code using the old enum-based error API must migrate to the new struct-based kind() pattern. Check the release notes for migration details

Update: cargo update github-copilot or check your Cargo.toml for the latest Copilot SDK version.

Source: Copilot SDK