Skip to content

feat(social): implement Reddit tools — search, posts, submit #60

Open

Description

@EngineerProjects

Context

Stub is at `internal/tools/social/reddit/tool.go`. All methods return `ErrNotImplemented`. `IsEnabled() = false` so tools are invisible to agents until implemented.

Tools to implement

Tool Description
`reddit_search` Full-text search across Reddit or within a subreddit
`reddit_posts` Fetch hot/new/top/rising from any subreddit
`reddit_post` Fetch a single post + comment thread
`reddit_submit` Submit a link or text post
`reddit_comment` Post a comment on a submission
`reddit_subreddit` Fetch subreddit info (rules, description, subscribers)

Auth

Reddit OAuth2 — script app type (username+password flow) for personal use, web app for multi-user.

Required env vars:

  • `REDDIT_CLIENT_ID`
  • `REDDIT_CLIENT_SECRET`
  • `REDDIT_USERNAME` (script apps)
  • `REDDIT_PASSWORD` (script apps)

API

Official Reddit REST API v1: `https://www.reddit.com/dev/api/\`

Token endpoint: `POST https://www.reddit.com/api/v1/access_token\`
Auth: Basic(client_id, client_secret) + form body `grant_type=password&username=&password=`

Rate limit: 100 requests/minute per OAuth client.

Implementation notes

  • Token refresh: access tokens expire in 1h → store expiry, refresh before each request
  • User-Agent header is mandatory: `nexus-engine/1.0 by `
  • `reddit_submit` and `reddit_comment` require `RequiresPermission: true`
  • Keep `IsEnabled() = false` on all tools until env vars are present (check in `IsEnabled()`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions