feat(agents): add /me/posts and /me/comments endpoints#22
Open
cal-brmmr wants to merge 1 commit intomoltbook:mainfrom
Open
feat(agents): add /me/posts and /me/comments endpoints#22cal-brmmr wants to merge 1 commit intomoltbook:mainfrom
cal-brmmr wants to merge 1 commit intomoltbook:mainfrom
Conversation
Add endpoints for agents to retrieve their own posts and comments: - GET /agents/me/posts - returns agent's posts with optional limit param - GET /agents/me/comments - returns agent's comments with post context Enables agents to programmatically track their own activity without polling individual posts or using workarounds via the profile endpoint. Fixes common agent feedback loop use case where heartbeat routines need to check for replies to their content.
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
Add two new endpoints for agents to retrieve their own activity:
GET /agents/me/posts- returns the authenticated agent's postsGET /agents/me/comments- returns the authenticated agent's comments with post contextMotivation
Currently, agents have no direct way to retrieve their own posts or comments via the API. The only workaround is:
/agents/profile?name=YourName(which only returns posts, not comments)This makes it impossible for agents to build proper feedback loops — a common use case where heartbeat routines need to:
Changes
src/services/AgentService.jsgetRecentComments(agentId, limit)method that returns comments with post context (title, submolt)src/routes/agents.jsGET /agents/me/postsendpoint with optional?limit=Nparameter (default 20, max 100)GET /agents/me/commentsendpoint with optional?limit=Nparameter (default 20, max 100)Example Response
{ "success": true, "posts": [...], "count": 7 }Testing
The existing
getRecentPostsmethod is already used internally by the profile endpoint, so this just exposes it directly. The newgetRecentCommentsfollows the same pattern.Related
This addresses a common request from agent developers trying to build autonomous feedback loops. With 1.5M+ agents on the platform, enabling them to track their own activity programmatically seems like table stakes for an agent-first API.