summaryrefslogtreecommitdiffhomepage
path: root/.rules/plan
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-03-31 20:22:45 +0900
committerAdam Malczewski <[email protected]>2026-03-31 20:22:45 +0900
commit3e32dec579fbdedec8c7ddb881207b25bb342e60 (patch)
tree9db02b8f744fa2c1203b78e6c84a62f770bc1e73 /.rules/plan
parenta1eed75083df6afd4895a4438309319d2a9e5523 (diff)
downloaddispatch-adapter-copilot-3e32dec579fbdedec8c7ddb881207b25bb342e60.tar.gz
dispatch-adapter-copilot-3e32dec579fbdedec8c7ddb881207b25bb342e60.zip
imp
Diffstat (limited to '.rules/plan')
-rw-r--r--.rules/plan/dispatch-adapter-copilot-plan.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/.rules/plan/dispatch-adapter-copilot-plan.md b/.rules/plan/dispatch-adapter-copilot-plan.md
index 45e6f4d..886ad5c 100644
--- a/.rules/plan/dispatch-adapter-copilot-plan.md
+++ b/.rules/plan/dispatch-adapter-copilot-plan.md
@@ -69,7 +69,7 @@ An abstract base class that all adapters must subclass.
- `chat(messages, system: nil, tools: [], stream: false, max_tokens: nil, &block)` — Send a chat completion request.
- `messages` — `Array<Message>` (canonical structs, not raw hashes).
- `system:` — `String` or `nil`. System prompt. Adapters handle placement differences (Claude: top-level param; Copilot/OpenAI: system role message).
- - `tools:` — `Array<ToolDefinition>`. Tools available to the model. Empty = no tools.
+ - `tools:` — `Array<ToolDefinition>` or `Array<Hash>`. Tools available to the model. Empty = no tools. Accepts both `ToolDefinition` structs and plain hashes with `name`, `description`, `parameters` keys (duck-typed — `Registry#to_a` returns plain hashes to avoid cross-gem dependency).
- `stream:` — `Boolean`. If `true`, yields `StreamDelta` objects to the block.
- `max_tokens:` — `Integer` or `nil`. Per-call override of the constructor default.
- **Return:** `Dispatch::Adapter::Response`.
@@ -172,7 +172,7 @@ The Copilot adapter maps HTTP status codes to these error classes.
- The adapter interface will be extracted into its own gem post-MVP (Phase 7). For now it lives here.
- Streaming support is required for ActionCable relay in the Rails app.
-- All adapters accept and return canonical structs (`Message`, `Response`, `ToolUseBlock`, etc.) — not raw hashes.
+- All adapters accept and return canonical structs (`Message`, `Response`, `ToolUseBlock`, etc.) — not raw hashes. **Exception:** the `tools:` parameter on `chat` accepts both `ToolDefinition` structs and plain hashes (duck-typed on `name`/`description`/`parameters`), since `Registry#to_a` returns plain hashes to avoid a cross-gem dependency.
- The response format is consistent regardless of which adapter is used — the Rails agent loop depends on it.
- Thread-safety: adapters may be called from multiple GoodJob workers concurrently. Ensure no shared mutable state.
- `system:` is a separate parameter on `chat`, not a message role. Adapters handle placement internally.