diff options
| author | Adam Malczewski <[email protected]> | 2026-03-31 20:22:45 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-03-31 20:22:45 +0900 |
| commit | 3e32dec579fbdedec8c7ddb881207b25bb342e60 (patch) | |
| tree | 9db02b8f744fa2c1203b78e6c84a62f770bc1e73 /.rules/changelog/2026-03/31/03.md | |
| parent | a1eed75083df6afd4895a4438309319d2a9e5523 (diff) | |
| download | dispatch-adapter-copilot-3e32dec579fbdedec8c7ddb881207b25bb342e60.tar.gz dispatch-adapter-copilot-3e32dec579fbdedec8c7ddb881207b25bb342e60.zip | |
imp
Diffstat (limited to '.rules/changelog/2026-03/31/03.md')
| -rw-r--r-- | .rules/changelog/2026-03/31/03.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/.rules/changelog/2026-03/31/03.md b/.rules/changelog/2026-03/31/03.md new file mode 100644 index 0000000..e2e8ecc --- /dev/null +++ b/.rules/changelog/2026-03/31/03.md @@ -0,0 +1,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. |
