summaryrefslogtreecommitdiffhomepage
path: root/.rules/changelog/2026-03/31/03.md
diff options
context:
space:
mode:
Diffstat (limited to '.rules/changelog/2026-03/31/03.md')
-rw-r--r--.rules/changelog/2026-03/31/03.md13
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.