Add list_messages method — read group message history #3

Closed
opened 2026-03-26 06:10:36 +00:00 by forgejo_admin · 1 comment

Type

Feature

Lineage

Discovered scope from GroupMe incident session (2026-03-25). Remote SSH workflow needs GroupMe as bidirectional communication channel.

Repo

forgejo_admin/groupme-sdk

User Story

As platform operator working via SSH,
I want to read GroupMe message history,
So that I can see messages, images, and context Marcus sends without leaving the terminal.

Context

The SDK currently only has send_message. There's no way to read messages. When Lucas is SSH'd into the platform, GroupMe is the communication channel with Marcus. Reading messages (including image attachments) is essential for this workflow.

GroupMe API: GET /groups/{group_id}/messages with params before_id, since_id, after_id, limit (max 100).

File Targets

Files to modify:

  • src/groupme_sdk/messages.py — ADD list_messages(group_id, before_id=None, since_id=None, after_id=None, limit=20) method. Returns list of message dicts with text, attachments, sender info, timestamps.

Files NOT to touch:

  • Other SDK files — this is a single method addition

Acceptance Criteria

  • list_messages(group_id) returns recent messages (default 20)
  • before_id param for pagination (older messages)
  • since_id param for new messages since a known message
  • Each message includes: text, sender name, created_at, attachments (image URLs)
  • Follows existing SDK patterns (uses _request, returns dicts)

Test Expectations

  • Unit test: list_messages returns message list
  • Unit test: pagination params passed correctly
  • Unit test: empty group returns empty list
  • Run command: cd ~/groupme-sdk && pytest tests/

Constraints

  • Follow existing SDK patterns exactly (MessagesMixin, _request method)
  • GroupMe API max limit is 100 per call
  • Keep it simple — no automatic pagination, just expose the API params

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • project-groupme-westside — GroupMe project page
  • Companion MCP ticket needed on groupme-mcp
### Type Feature ### Lineage Discovered scope from GroupMe incident session (2026-03-25). Remote SSH workflow needs GroupMe as bidirectional communication channel. ### Repo `forgejo_admin/groupme-sdk` ### User Story As platform operator working via SSH, I want to read GroupMe message history, So that I can see messages, images, and context Marcus sends without leaving the terminal. ### Context The SDK currently only has `send_message`. There's no way to read messages. When Lucas is SSH'd into the platform, GroupMe is the communication channel with Marcus. Reading messages (including image attachments) is essential for this workflow. GroupMe API: `GET /groups/{group_id}/messages` with params `before_id`, `since_id`, `after_id`, `limit` (max 100). ### File Targets Files to modify: - `src/groupme_sdk/messages.py` — ADD `list_messages(group_id, before_id=None, since_id=None, after_id=None, limit=20)` method. Returns list of message dicts with text, attachments, sender info, timestamps. Files NOT to touch: - Other SDK files — this is a single method addition ### Acceptance Criteria - [ ] `list_messages(group_id)` returns recent messages (default 20) - [ ] `before_id` param for pagination (older messages) - [ ] `since_id` param for new messages since a known message - [ ] Each message includes: text, sender name, created_at, attachments (image URLs) - [ ] Follows existing SDK patterns (uses `_request`, returns dicts) ### Test Expectations - [ ] Unit test: list_messages returns message list - [ ] Unit test: pagination params passed correctly - [ ] Unit test: empty group returns empty list - Run command: `cd ~/groupme-sdk && pytest tests/` ### Constraints - Follow existing SDK patterns exactly (MessagesMixin, _request method) - GroupMe API max limit is 100 per call - Keep it simple — no automatic pagination, just expose the API params ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `project-groupme-westside` — GroupMe project page - Companion MCP ticket needed on groupme-mcp
Author
Owner

Scope Review: READY

Review note: review-378-2026-03-25
Scope is solid — all template sections present, file targets verified against codebase, dependencies documented. One implementation note: _request will return {"count": N, "messages": [...]} after envelope strip, so the method should extract result.get("messages", []) to match the acceptance criteria's "returns list of message dicts" expectation.

## Scope Review: READY Review note: `review-378-2026-03-25` Scope is solid — all template sections present, file targets verified against codebase, dependencies documented. One implementation note: `_request` will return `{"count": N, "messages": [...]}` after envelope strip, so the method should extract `result.get("messages", [])` to match the acceptance criteria's "returns list of message dicts" expectation.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo_admin/groupme-sdk#3
No description provided.