mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
feat(tools): add reaction tool and reply-aware message sends (#2156)
- Add `reaction` tool that reacts to a message (defaults to current inbound message via context) - Extend `message` tool with optional `reply_to_message_id` parameter - Introduce `WithToolInboundContext` to inject inbound message IDs into tool execution context - Surface `MessageID` and `ReplyToMessageID` in `processOptions` for tool-surface consumption Refs #2137
This commit is contained in:
@@ -531,6 +531,20 @@ func TestToolContext_Updates(t *testing.T) {
|
||||
if got := tools.ToolChannel(context.Background()); got != "" {
|
||||
t.Errorf("expected empty channel from bare context, got %q", got)
|
||||
}
|
||||
|
||||
inboundCtx := tools.WithToolInboundContext(
|
||||
context.Background(),
|
||||
"telegram",
|
||||
"chat-42",
|
||||
"msg-123",
|
||||
"msg-100",
|
||||
)
|
||||
if got := tools.ToolMessageID(inboundCtx); got != "msg-123" {
|
||||
t.Errorf("expected messageID 'msg-123', got %q", got)
|
||||
}
|
||||
if got := tools.ToolReplyToMessageID(inboundCtx); got != "msg-100" {
|
||||
t.Errorf("expected replyToMessageID 'msg-100', got %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
// TestToolRegistry_GetDefinitions verifies tool definitions can be retrieved
|
||||
|
||||
Reference in New Issue
Block a user