blob: e2e8ecc8cfd603c03be60173b5543f8b033bab78 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
# Changelog — 2026-03-31 #03
## Accept plain hashes as tool definitions in chat
### Modified Files
- **lib/dispatch/adapter/copilot.rb** — Updated `build_wire_tools` to use a new `tool_attr` helper method instead of direct method calls. Added `tool_attr(tool, key)` private method that supports both struct-style method access and Hash-style key access (symbol and string keys). This allows `chat(tools:)` to accept plain hashes alongside `ToolDefinition` structs.
- **spec/dispatch/adapter/copilot_spec.rb** — Added 3 tests: plain hashes with symbol keys, plain hashes with string keys, and mixed ToolDefinition structs + plain hashes.
- **README.md** — Updated Tool Calling section to document plain hash support and added a usage example.
### Rationale
The Dispatch tool registry (`Registry#to_a`) returns plain hashes to avoid cross-gem dependencies. This change allows adapters to accept tools from the registry without requiring a conversion step.
|