Skip to content

Document message tool and add integration test#137

Merged
rookdaemon merged 4 commits intomainfrom
copilot/implement-message-tool
Feb 7, 2026
Merged

Document message tool and add integration test#137
rookdaemon merged 4 commits intomainfrom
copilot/implement-message-tool

Conversation

Copy link
Contributor

Copilot AI commented Feb 7, 2026

The message tool implementation was complete but undocumented. Users had no configuration examples, and there was no test demonstrating tool usage within the agent loop.

Changes

Documentation (docs/example-daemon.yaml)

  • Added channels section with configuration examples for Discord webhooks, Matrix rooms, and generic webhooks
  • Included body template syntax and custom header examples

Integration test (test/agent.test.ts)

  • Added test demonstrating message tool execution within the agent ReAct loop
  • Verifies tool call flow: LLM requests tool → tool executes → LLM processes result

Example Configuration

channels:
  discord-general:
    type: "discord-webhook"
    url: "https://discord.com/api/webhooks/123/token"
  
  matrix-ops:
    type: "matrix"
    homeserver: "https://matrix.org"
    room_id: "!room:matrix.org"
    access_token: "${MATRIX_TOKEN}"
  
  alerts:
    type: "webhook"
    url: "https://example.com/webhook"
    headers:
      "X-Custom-Header": "value"
    body_template: '{"text": "{{content}}"}'

The tool itself (src/tools/message.ts, src/config.ts, test/message.test.ts) was already implemented with proper validation, error handling, and 15 unit tests.

Original prompt

This section details on the original issue you should resolve

<issue_title>Implement message tool for channel communication</issue_title>
<issue_description>## Problem
Rook cannot communicate via Discord/Matrix channels autonomously. External webhook triggers work, but no outbound messaging.

Requirement

Implement message tool:

  • Parameters: {channel, content, target?}
  • Abstract channel via config (daemon.yaml)
  • Start with Discord webhook (simplest path)
  • Future: Matrix, other protocols

Acceptance Criteria

  • Tool registered in registry
  • Channel config in daemon.yaml (webhook URLs)
  • Discord webhook implementation
  • Message content validation (length limits, formatting)
  • Error handling for network failures, invalid channels
  • Unit tests (mocked webhook)
  • Integration test with agent loop

References

  • Gap Analysis P1-4
  • Discord webhook API: simple POST with JSON body

Priority

P1 - Required for full Rook autonomy</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 7, 2026 23:16
Co-authored-by: rookdaemon <258400181+rookdaemon@users.noreply.github.com>
Co-authored-by: rookdaemon <258400181+rookdaemon@users.noreply.github.com>
@rookdaemon rookdaemon marked this pull request as ready for review February 7, 2026 23:20
Copilot AI changed the title [WIP] Implement message tool for channel communication Document message tool and add integration test Feb 7, 2026
Copilot AI requested a review from rookdaemon February 7, 2026 23:21
@rookdaemon rookdaemon merged commit 1ac9555 into main Feb 7, 2026
@rookdaemon rookdaemon deleted the copilot/implement-message-tool branch February 7, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement message tool for channel communication

2 participants