Coding Agent & Slack Tags
Relevant source files
The following files were used as context for generating this wiki page:
- app/coding/page.tsx
- components/CodingAgentSlackTags/CodingAgentSlackTagsPage.tsx
- components/CodingAgentSlackTags/SlackTagsTable.tsx
- hooks/useCodingPrStatus.ts
- lib/coding-agent/getTagsByDate.ts
- types/coding-agent.ts
- lib/recoup/fetchSlackTags.ts
- lib/recoup/fetchCodingPrStatus.ts
- components/CodingAgentSlackTags/createSlackTagsColumns.tsx
The Coding Agent & Slack Tags module provides administrative oversight into how the Recoup Coding Agent is utilized within Slack. It tracks mentions (tags) of the agent, the specific prompts provided by users, and the resulting engineering output in the form of GitHub Pull Requests (PRs).
This system allows administrators to monitor agent activity, calculate conversion rates from Slack interactions to merged code, and visualize usage trends over time. The module integrates data from the Slack API and GitHub via a centralized administrative backend.
Sources: components/CodingAgentSlackTags/CodingAgentSlackTagsPage.tsx:28-32, types/coding-agent.ts:1-12
System Architecture & Data Flow
The system follows a reactive data-fetching pattern. It first retrieves Slack tag events for a selected time period. Once the tag data is available, it extracts all Pull Request URLs and performs a secondary lookup to determine the current status (e.g., merged, open) of those PRs.
Analytics Pipeline Flow
The following diagram illustrates the sequence of operations from the user selecting a time period to the final rendered dashboard.
Data Models
The system relies on structured interfaces to represent Slack interactions and their relationship to code changes.
Core Entities
| Interface | Field | Type | Description |
|---|---|---|---|
| SlackTag | user_id | string | Unique Slack ID of the tagger |
prompt | string | The text sent to the Coding Agent | |
channel_name | string | Name of the Slack channel where tagged | |
pull_requests | string[] | List of GitHub PR URLs generated | |
| CodingPrStatus | url | string | Full GitHub PR URL |
status | "open" | "closed" | "merged" | Current lifecycle state of the PR |
Sources: types/coding-agent.ts:1-25
Analytics & Aggregation
Data is aggregated locally for visualization. The getTagsByDate utility processes raw tag logs into daily buckets for time-series charts.
Metrics Calculated
- Total Tags: Count of all Slack mentions of the agent.
- Tags with PRs: Count of mentions that resulted in at least one Pull Request.
- Merged PRs: Count of unique PRs associated with tags that have reached the "merged" state.
- Conversion: The percentage of total tags that resulted in a merged PR (
totalMergedPrs / totalTags).
Sources: lib/coding-agent/getTagsByDate.ts:17-30, components/CodingAgentSlackTags/CodingAgentSlackTagsPage.tsx:45-56
Aggregation Logic
The aggregation logic iterates through the tags to build a TagsByDateEntry array.
API Integration
The module interacts with two primary administrative endpoints. All requests require a Privy access token passed in the Authorization header.
Endpoints
GET /api/admins/coding/slack
Fetches Slack tag events.
- Parameters:
period(all, daily, weekly, monthly) - Response:
SlackTagsResponse
Sources: lib/recoup/fetchSlackTags.ts:14-22
GET /api/admins/coding/pr
Checks the status of specific GitHub Pull Requests.
- Parameters:
pull_requests(array of URLs passed as query parameters) - Response:
CodingPrStatusResponse
Sources: lib/recoup/fetchCodingPrStatus.ts:16-25
UI Components
The interface is divided into a statistical header, a trend chart, and a detailed data table.
- AdminLineChart: Displays three lines representing total tags, tags with PRs, and PRs merged over time.
- SlackTagsTable: A sortable table using
@tanstack/react-table. It identifies merged PRs in the "Pull Requests" column with a "🚢" icon. - PeriodSelector: Allows users to filter the data by different time ranges (e.g., weekly or monthly).
Sources: components/CodingAgentSlackTags/CodingAgentSlackTagsPage.tsx:84-110, components/CodingAgentSlackTags/createSlackTagsColumns.tsx:55-65, components/CodingAgentSlackTags/SlackTagsTable.tsx:29-37
Summary
The Coding Agent & Slack Tags module provides a critical link between user requests in Slack and final code merges. By aggregating data across multiple sources (Slack and GitHub), it offers a unified view of agent productivity and conversion metrics within the Recoup Admin dashboard.