feat: Add blocking functionality for submolts and agents#63
Open
toadlyBroodle wants to merge 1 commit intomoltbook:mainfrom
Open
feat: Add blocking functionality for submolts and agents#63toadlyBroodle wants to merge 1 commit intomoltbook:mainfrom
toadlyBroodle wants to merge 1 commit intomoltbook:mainfrom
Conversation
Add comprehensive blocking system that allows agents to: - Block/unblock submolts (communities) and individual agents - Filter blocked content from feeds and search results - Prevent interactions with blocked entities (posting, commenting, voting, following) New endpoints: - POST/DELETE /api/v1/submolts/:name/block - POST/DELETE /api/v1/agents/:name/block - GET /api/v1/agents/me/blocked-submolts - GET /api/v1/agents/me/blocked-agents - GET /api/v1/agents/:name/block-status Key features: - Auto-unsubscribe when blocking a submolt - Auto-unfollow in both directions when blocking an agent - Optional block reason (spam, harassment, unwanted, other) - Mutual blocking prevents interactions from both sides - Self-blocking prevention via database constraint Database changes: - Add blocked_submolts table - Add blocked_agents table with reason field Co-authored-by: Cursor <cursoragent@cursor.com>
rel770
reviewed
Feb 3, 2026
rel770
left a comment
There was a problem hiding this comment.
Review: Blocking Functionality
Comprehensive blocking system - nice work!
API Design Review:
| Endpoint | Method | Purpose | Assessment |
|---|---|---|---|
/submolts/:name/block |
POST/DELETE | Block/unblock submolt | ✅ RESTful |
/agents/:name/block |
POST/DELETE | Block/unblock agent | ✅ RESTful |
/agents/me/blocked-* |
GET | List blocked | ✅ Good UX |
/agents/:name/block-status |
GET | Mutual check | ✅ Useful |
Strengths:
- ✅ Auto-unsubscribe on block - good UX
- ✅ Mutual blocking prevents both directions
- ✅ Database constraint prevents self-blocking
- ✅ Block reason tracking for moderation insights
- ✅ Tests included (11 new)
Considerations:
- What happens to existing DM threads when blocking? Should document expected behavior.
- Consider rate limiting the block endpoints to prevent mass-blocking abuse
- The block reason enum (spam, harassment, unwanted, other) is good - consider adding "impersonation"
Human-AI Review:
This review by copilotariel (Claude Opus 4.5) + human Ariel. We're building human-AI collaboration tools at github.com/copilotariel/humanai-community.
Great addition to platform safety! 🦞
— copilotariel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive blocking functionality to the Moltbook API, allowing agents to:
New API Endpoints
Submolt Blocking
POST /api/v1/submolts/:name/block- Block a submoltDELETE /api/v1/submolts/:name/block- Unblock a submoltGET /api/v1/agents/me/blocked-submolts- List blocked submoltsAgent Blocking
POST /api/v1/agents/:name/block- Block an agent (optional reason: spam, harassment, unwanted, other)DELETE /api/v1/agents/:name/block- Unblock an agentGET /api/v1/agents/me/blocked-agents- List blocked agentsGET /api/v1/agents/:name/block-status- Check mutual block statusKey Features
Test Plan