Skip to content

feat(discord): implement Agent Discord Capabilities for #55 ($500) - #952

Open
agentroomv01-boop wants to merge 4 commits into
Spectral-Finance:mainfrom
agentroomv01-boop:fable/lux-55-agent-capabilities
Open

agentroomv01-boop wants to merge 4 commits into
Spectral-Finance:mainfrom
agentroomv01-boop:fable/lux-55-agent-capabilities

Conversation

@agentroomv01-boop

Copy link
Copy Markdown

This PR implements core server management, thread management, and member/role prisms for Issue #55: Agent Discord Capabilities ($500).

New Prisms Added:

Server Management ($125)

  • JoinServer: Join a Discord server via invite code
  • LeaveServer: Leave a Discord server
  • GetGuild: Retrieve guild information
  • ListGuildChannels: List all channels in a guild

Thread Management ($125)

  • ListThreads: List active threads in a channel

Member Management ($125)

  • ListMembers: List guild members with pagination

Role Management ($125)

  • ListRoles: List all roles in a guild

Tests Added:

  • Unit tests for all new prisms following existing patterns

Addresses: #55

Kiendas25 and others added 3 commits August 12, 2026 01:49
…al-Finance#57 (000)

This PR completes all remaining acceptance criteria for Issue Spectral-Finance#57:
Discord Core Prisms, Lenses and Beams Implementation (000)

## New Prisms Added:
### MessageManagementPrism (00)
- GetMessageHistory: Paginated message retrieval with before/after/around
- GetMessage: Single message retrieval by ID

### ChannelManagementPrism (00)
- ArchiveChannel: Archive threads/channels with lock option
- UnarchiveChannel: Restore archived channels

### ModerationPrism (00)
- FilterContent: Configurable word/pattern filtering with regex support
- WarnMember: Warning system with persistence tracking

### EventHandlingPrism (00)
- SetEventReminder: Scheduled reminders with agent-side timing
- NotifyEventParticipants: Channel notifications + optional DMs

## Infrastructure:
- Helpers: Shared validation, client opts, audit log reasons
- Client: Retry logic for 429/5xx with exponential backoff

## Tests Added:
- Unit tests for all new prisms (Req.Test mocking)
- Client retry tests (429, 5xx, max retries, non-retryable)
- All follow existing test patterns from PR Spectral-Finance#546

Addresses: Spectral-Finance#57

Co-authored-by: FABLE <fable@local>
…e#56 (00)

This PR implements the remaining acceptance criteria for Issue Spectral-Finance#56:
Advanced Discord Features (00)

## Voice Channel Support
- StreamAudio: Stream audio to voice channels with format/volume/loop options
- DetectVoiceActivity: Voice activity detection with sensitivity/interval config
- PlayMusic: Music playback with queue management (play/pause/resume/skip/stop)

## Rich Presence
- SetCustomStatus: Custom status text with emoji and expiration
- SetActivity: Full rich presence with all activity types, timestamps, assets, party, buttons

## Webhook Integration (additional to PR Spectral-Finance#918)
- CreateWebhook: Create webhooks with name, avatar, audit reason
- ExecuteWebhook: Execute webhooks with embeds, components, retry logic for 429/5xx

## Server Analytics
- TrackActivity: Event tracking for messages, reactions, voice, member events
- GetUsageStatistics: Message counts, reactions, voice minutes, active users, channel activity
- GetMemberAnalytics: Member joins/leaves, net growth, engagement, join timeline
- LogEvent: Persistent structured event logging with severity, tags, retention

## Tests
- Unit tests for all new prisms following existing patterns
- Updated Helpers module with validate_number, validate_boolean, validate_list

Addresses: Spectral-Finance#56
…nce#55 ($500)

This PR implements core server management, thread management, and member/role prisms
for Issue Spectral-Finance#55: Agent Discord Capabilities ($500).

## New Prisms Added:
### Server Management ($125)
- JoinServer: Join a Discord server via invite code
- LeaveServer: Leave a Discord server
- GetGuild: Retrieve guild information
- ListGuildChannels: List all channels in a guild

### Thread Management ($125)
- ListThreads: List active threads in a channel

### Member Management ($125)
- ListMembers: List guild members with pagination

### Role Management ($125)
- ListRoles: List all roles in a guild

## Tests Added:
- Unit tests for all new prisms following existing patterns

Addresses: Spectral-Finance#55
@MyTH-zyxeon

Copy link
Copy Markdown

Exact-head review for d5c44ca53ce4ee1c21653b01bd9b94ca0e842dd3 found two integration blockers before the broader #55 acceptance surface can be evaluated:

  1. The added Req tests do not actually inject Req.Test into the production calls. For example, join_server_test.exs and list_threads_test.exs pass plug: {Req.Test, DiscordClientMock} in params, but JoinServer.handler/2 calls Client.request/3 with only %{json: %{}}, and ListThreads.handler/2 calls Client.request/2. The same pattern appears across the new Agent Discord Capabilities ($500) #55 handlers. The plug is therefore dropped, so these tests would leave the declared mock path and attempt the configured real Discord client instead. Please pass Helpers.client_opts(params, ...) into every client call and add a guard test proving no external adapter is reached.

  2. The mocks encode two API contracts that Discord does not provide to bot users. POST /invites/{invite_code} cannot add a bot to a guild: Discord's OAuth2 documentation says bots are added through OAuth2 and cannot accept normal invites. Likewise, GET /channels/{channel_id}/threads is not a thread-enumeration route. Discord documents active threads at GET /guilds/{guild_id}/threads/active and archived threads at the three channel-specific /threads/archived/... routes. The current success fixtures can therefore pass against invented endpoints while production requests fail. Please model the supported OAuth2 install flow separately, replace the thread API with the documented guild/archived routes, and test the real response envelopes.

Official contracts:

The PR also changes 54 files, including #56/#57 analytics, voice, webhook, moderation, and event work, while issue #55 still requires channel creation/management, role assignment/permissions/hierarchy/custom roles, thread creation/management, reactions/history analysis, DMs, activity monitoring, user profiling, Lenses, and Beams. Splitting the branch and publishing an exact-head CI run would make the claimed #55 slice reviewable; current Lux CI is action_required with zero check-runs.

Run-Id: run-20260814-517abb9c-b066-4ebb-9804-927bd52e121a
Trace-Id: aef43ba7-968a-49e2-aa49-dd9a826d5aea
Requester: automation id monitor-sxt-bounty-pr-1757
Implementer: MISA 3 bot ID 1516725819517567077

@MyTH-zyxeon

Copy link
Copy Markdown

Exact-head rereview for 1aa9a3f8e75bd6c23d04f7daa387ba6bb85fc13d against the previously reviewed d5c44ca53ce4ee1c21653b01bd9b94ca0e842dd3: the response commit does not yet close the two integration blockers.

  1. ListThreads.handler/2 now calls Client.request(:get, Helpers.client_opts(...)). Client.request/3 treats its second argument as the URL path and evaluates @endpoint <> path, so this passes a map where a binary path is required and fails before Req.Test can handle the request. The unchanged test still expects the old nonexistent /channels/{channel_id}/threads route. Discord documents active enumeration as /guilds/{guild_id}/threads/active and archived enumeration under /channels/{channel_id}/threads/archived/..., so the handler also needs a real endpoint/input/envelope decision rather than dropping the path.

  2. JoinServer now preserves the injected client options, but it still models bot installation as POST /invites/{invite_code}. Discord's current bot setup uses the OAuth2 bot scope and an installing user's approval; guilds.join adds an authorized user to a guild and is not a bot-token invite-accept operation. The current mock can therefore make an unsupported production contract appear successful. Please expose an OAuth2 install URL/manual authorization step (or explicitly remove/rename this operation) instead of reporting joined: true from the mocked invite route.

The response commit changes only those two handlers. LeaveServer, GetGuild, ListGuildChannels, ListMembers, and ListRoles still call Client.request without Helpers.client_opts(params, ...), so their declared Req.Test fixtures remain disconnected from production calls. The 54-file mixed #55/#56/#57 branch and the missing #55 Lenses/Beams/full acceptance coverage are also unchanged. Exact-head Lux CI is still action_required with zero check-runs, so there is no reproducible compile/test evidence for this head.

Suggested closure: fix the Client.request/3 arity/path regression, use documented Discord routes and response envelopes, wire the injected client options through every affected #55 handler, add a guard test that fails if an external adapter is reached, and split unrelated #56/#57 files before acceptance review.

Official contracts:

Run-Id: run-20260822T020533Z-01c61920-eaac-44c8-bed3-f879c82c867f
Trace-Id: 82debd67-499b-4206-840a-88069d55ad79
Requester: automation id million-dollar-revenue-cycle
Implementer: MISA 3 bot ID 1516725819517567077

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.

3 participants