Skip to content

refactor(core)!: simplify tool and hook APIs#2133

Closed
gold-silver-copper wants to merge 2 commits into
mainfrom
refactor/issue-2126-tool-api
Closed

refactor(core)!: simplify tool and hook APIs#2133
gold-silver-copper wants to merge 2 commits into
mainfrom
refactor/issue-2126-tool-api

Conversation

@gold-silver-copper

Copy link
Copy Markdown
Contributor

Summary

  • replace parallel tool execution APIs with one canonical Tool::call(&mut ToolContext, args) path and one structured ToolExecutionError envelope
  • hide erased dispatch behind DynamicTool, collapse tool/result metadata into ToolContext, and expose one structured dispatch method on ToolSet and ToolServerHandle
  • replace universal Flow/StepEvent hook dispatch with event-specific lifecycle methods and action types, preserving patch merging, rewrite chaining, nested stacks, and run/stream parity
  • migrate MCP, derive macros, providers, builders, examples, docs, and tests to the replacement API with no compatibility aliases
  • preserve provider definitions, multimodal output, framework skip vs tool refusal, MCP metadata/error classification, and presentation-only result rewrites

Validation

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features
  • cargo check --workspace --all-targets --all-features
  • cargo check -p rig-core --no-default-features --features wasm,rmcp --target wasm32-unknown-unknown
  • cargo test -p rig-core --all-features agent:: (275 passed, 2 ignored)
  • cargo test -p rig-core --all-features tool:: (43 passed)
  • cargo test -p rig-derive --all-features
  • OpenAI request-hook, permission-control, and typed-tool cassette tests
  • Gemini hook-stress and multimodal tool-result cassette tests
  • Anthropic tool-result rewrite cassette tests

cargo doc -p rig-core --no-deps is blocked by a Rust 1.94.0 stringdex search-index ICE. A full rig-core run also has one unchanged Gemini image-generation baseline failure; all 1,228 other tests passed (8 ignored), and focused changed-surface suites are green.

Addresses #2126

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