docs: add Content Agent Slack tags admin endpoint#81
docs: add Content Agent Slack tags admin endpoint#81recoup-coding-agent merged 5 commits intomainfrom
Conversation
- Guide page covering @mention syntax, data flow, setup, and troubleshooting
- OpenAPI spec entries for POST /api/content-agent/{platform} and POST /api/content-agent/callback
- API reference pages for webhook and callback endpoints
- Navigation updated with Agents group in Guides tab and Content Agent group in API reference
Co-Authored-By: Paperclip <noreply@paperclip.ing>
- Link POST /api/content-agent/callback to its API reference page in both the data flow section and endpoints table - Add missing RECOUP_API_KEY to environment variables table Co-Authored-By: Paperclip <noreply@paperclip.ing>
Add OpenAPI spec and MDX page for GET /api/admins/content/slack, following the existing coding/slack pattern. Response includes video_links instead of pull_requests. Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds documentation for a new admin content agent Slack analytics endpoint, updates the existing coding Slack endpoint schema to include pull request metrics, and extends the navigation structure to accommodate these additions. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@api-reference/openapi.json`:
- Around line 4633-4673: Update the "responses" -> "200" schema for the Slack
webhook endpoint so it documents both behaviors described in the "description":
keep the existing JSON shape with {"ok": boolean} for normal event processing
and add an alternative shape for Slack's url_verification challenge (e.g.,
{"challenge": string}) using oneOf or by adding an additional content/schema
option; modify the "responses" -> "200" entry referenced in the diff (the
existing "200" response block under "requestBody"/"responses") so the OpenAPI
spec accurately reflects both the event-acknowledgement and the url_verification
response shapes.
- Around line 4764-4767: The OpenAPI file uses a security requirement named
"callbackSecret" for the POST /api/content-agent/callback endpoint but never
declares that scheme; add a corresponding entry named "callbackSecret" under
components.securitySchemes describing the type and details (e.g., apiKey in
header/query or http bearer) to match how the endpoint expects to be
authenticated so the reference is valid; update components.securitySchemes with
a properly named scheme "callbackSecret" and ensure its "name", "in", or
"scheme"/"bearerFormat" fields align with the POST /api/content-agent/callback
implementation.
In `@content-agent.mdx`:
- Line 127: Replace the incorrect troubleshooting row that reads "No GitHub
repository found | Artist missing repo config | Ensure the artist account has a
linked GitHub repo" in content-agent.mdx: remove it or replace it with a
content-agent-specific entry such as "Missing artist assets | Artist has not
uploaded required media or metadata | Ensure the artist has uploaded required
assets (images/video/audio) and that content configuration/metadata is valid" so
the table reflects content-generation errors rather than GitHub-related issues.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3334bf86-1da0-4b16-ac74-7f06fb8cb662
📒 Files selected for processing (6)
api-reference/admins/content-slack-tags.mdxapi-reference/content-agent/callback.mdxapi-reference/content-agent/webhook.mdxapi-reference/openapi.jsoncontent-agent.mdxdocs.json
| "description": "Webhook endpoint for the Recoup Content Agent Slack bot. Receives @mention events from Slack and triggers content generation for the mentioned artist. The bot parses the mention text for `<artist_account_id> [template] [batch=N] [lipsync]`, validates the artist, calls POST /api/content/create, and starts a background polling task that reports results back to the Slack thread.\n\nFor Slack, also handles `url_verification` challenges during app setup.", | ||
| "parameters": [ | ||
| { | ||
| "name": "platform", | ||
| "in": "path", | ||
| "description": "Chat platform identifier. Currently supports `slack`.", | ||
| "required": true, | ||
| "schema": { | ||
| "type": "string", | ||
| "enum": ["slack"] | ||
| } | ||
| } | ||
| ], | ||
| "requestBody": { | ||
| "description": "Slack Events API payload (app_mention event or url_verification challenge)", | ||
| "required": true, | ||
| "content": { | ||
| "application/json": { | ||
| "schema": { | ||
| "type": "object", | ||
| "description": "Slack Events API envelope — the shape depends on the event type" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "responses": { | ||
| "200": { | ||
| "description": "Event processed successfully", | ||
| "content": { | ||
| "application/json": { | ||
| "schema": { | ||
| "type": "object", | ||
| "properties": { | ||
| "ok": { | ||
| "type": "boolean" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, |
There was a problem hiding this comment.
Align the webhook 200 response schema with the documented behaviors.
Line 4633 says the endpoint handles Slack url_verification, but Line 4659-Line 4670 only documents { ok: boolean }. Add a second response shape (or oneOf) for the verification flow so the spec matches the description.
📘 Suggested OpenAPI update
"200": {
- "description": "Event processed successfully",
+ "description": "Event processed successfully (event callback or url_verification)",
"content": {
"application/json": {
"schema": {
- "type": "object",
- "properties": {
- "ok": {
- "type": "boolean"
- }
- }
+ "oneOf": [
+ {
+ "type": "object",
+ "required": ["ok"],
+ "properties": {
+ "ok": { "type": "boolean" }
+ }
+ },
+ {
+ "type": "object",
+ "required": ["challenge"],
+ "properties": {
+ "challenge": { "type": "string" }
+ }
+ }
+ ]
}
}
}
},🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@api-reference/openapi.json` around lines 4633 - 4673, Update the "responses"
-> "200" schema for the Slack webhook endpoint so it documents both behaviors
described in the "description": keep the existing JSON shape with {"ok":
boolean} for normal event processing and add an alternative shape for Slack's
url_verification challenge (e.g., {"challenge": string}) using oneOf or by
adding an additional content/schema option; modify the "responses" -> "200"
entry referenced in the diff (the existing "200" response block under
"requestBody"/"responses") so the OpenAPI spec accurately reflects both the
event-acknowledgement and the url_verification response shapes.
| "security": [ | ||
| { | ||
| "callbackSecret": [] | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
python - <<'PY'
import json, sys
with open("api-reference/openapi.json", "r", encoding="utf-8") as f:
spec = json.load(f)
declared = set(spec.get("components", {}).get("securitySchemes", {}).keys())
missing = []
for path, path_item in spec.get("paths", {}).items():
for method, op in path_item.items():
if method.lower() not in {"get", "post", "put", "patch", "delete", "options", "head", "trace"}:
continue
for sec in op.get("security", []):
for scheme_name in sec.keys():
if scheme_name not in declared:
missing.append((path, method.upper(), scheme_name))
if missing:
print("Missing security scheme declarations:")
for path, method, name in missing:
print(f"- {method} {path}: {name}")
sys.exit(1)
print("All operation security schemes are declared.")
PYRepository: recoupable/docs
Length of output: 147
Declare callbackSecret under components.securitySchemes.
The OpenAPI specification references callbackSecret in the POST /api/content-agent/callback endpoint security requirement (lines 4764-4767), but this security scheme is not declared in components.securitySchemes. This violates the OpenAPI standard and will fail validation.
🛠️ Suggested fix
"securitySchemes": {
+ "callbackSecret": {
+ "type": "apiKey",
+ "in": "header",
+ "name": "x-callback-secret",
+ "description": "Shared secret for internal content-agent callback requests."
+ },
"bearerAuth": {
"type": "http",
"scheme": "bearer"
},📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "security": [ | |
| { | |
| "callbackSecret": [] | |
| } | |
| "securitySchemes": { | |
| "callbackSecret": { | |
| "type": "apiKey", | |
| "in": "header", | |
| "name": "x-callback-secret", | |
| "description": "Shared secret for internal content-agent callback requests." | |
| }, | |
| "bearerAuth": { | |
| "type": "http", | |
| "scheme": "bearer" | |
| }, |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@api-reference/openapi.json` around lines 4764 - 4767, The OpenAPI file uses a
security requirement named "callbackSecret" for the POST
/api/content-agent/callback endpoint but never declares that scheme; add a
corresponding entry named "callbackSecret" under components.securitySchemes
describing the type and details (e.g., apiKey in header/query or http bearer) to
match how the endpoint expects to be authenticated so the reference is valid;
update components.securitySchemes with a properly named scheme "callbackSecret"
and ensure its "name", "in", or "scheme"/"bearerFormat" fields align with the
POST /api/content-agent/callback implementation.
| |-------|-------|-----| | ||
| | No response from bot | Event subscription URL not configured | Check Slack app Event Subscriptions | | ||
| | "Artist not found" | Invalid `artist_account_id` | Verify the UUID exists in the platform | | ||
| | "No GitHub repository found" | Artist missing repo config | Ensure the artist account has a linked GitHub repo | |
There was a problem hiding this comment.
Incorrect troubleshooting entry for Content Agent context.
The error "No GitHub repository found" and the fix "Ensure the artist account has a linked GitHub repo" appear to be copied from coding agent documentation. The Content Agent generates videos for artists and doesn't require GitHub repositories. This troubleshooting entry should either be removed or replaced with a content-generation-specific error (e.g., missing artist assets, invalid content configuration).
🔧 Suggested fix
-| "No GitHub repository found" | Artist missing repo config | Ensure the artist account has a linked GitHub repo |
+| "Artist not ready for content creation" | Missing required artist assets | Verify the artist has profile data, images, and content via [`GET /api/content/validate`](/api-reference/content/validate) |🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@content-agent.mdx` at line 127, Replace the incorrect troubleshooting row
that reads "No GitHub repository found | Artist missing repo config | Ensure the
artist account has a linked GitHub repo" in content-agent.mdx: remove it or
replace it with a content-agent-specific entry such as "Missing artist assets |
Artist has not uploaded required media or metadata | Ensure the artist has
uploaded required assets (images/video/audio) and that content
configuration/metadata is valid" so the table reflects content-generation errors
rather than GitHub-related issues.
Add total_pull_requests and tags_with_pull_requests fields to match the actual API response. Update description and examples accordingly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
GET /api/admins/content/slackendpoint following existing/api/admins/coding/slackpatternapi-reference/admins/content-slack-tags.mdxdocs.jsonvideo_links(Content Agent) instead ofpull_requests(Coding Agent)Test plan
openapi.jsonis valid JSON🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation