Skip to content

Comments

refactor(tools): typed deserialization for tool call params#540

Merged
bug-ops merged 1 commit intomainfrom
feat/typed-tool-params
Feb 18, 2026
Merged

refactor(tools): typed deserialization for tool call params#540
bug-ops merged 1 commit intomainfrom
feat/typed-tool-params

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 18, 2026

Summary

  • Add generic deserialize_params<T> helper that wraps serde_json::from_value with ToolError::InvalidParams mapping
  • Derive Deserialize on all param structs (BashParams, ReadParams, WriteParams, EditParams, GlobParams, GrepParams), remove #[allow(dead_code)]
  • Migrate ShellExecutor, FileExecutor, WebScrapeExecutor from manual HashMap extraction to typed deserialization
  • Remove dead helpers (param_str, param_usize)
  • Add 10 new tests covering deserialization edge cases

Closes #460, closes #461, closes #475

Test plan

  • cargo +nightly fmt --check passes
  • cargo clippy --workspace -- -D warnings — 0 warnings
  • cargo nextest run --workspace --lib --bins — 1635 passed, 9 skipped

Replace manual HashMap param extraction with serde_json::from_value
via a generic deserialize_params<T> helper. Add Deserialize derive to
all param structs, remove #[allow(dead_code)], and introduce
ToolError::InvalidParams variant for deserialization failures.

Closes #460, closes #461
@bug-ops bug-ops merged commit 1522ff9 into main Feb 18, 2026
18 checks passed
@bug-ops bug-ops deleted the feat/typed-tool-params branch February 18, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

1 participant