anomalyco / anomalyco/opencode
Message pagination accepts malformed cursor characters
Open
@neriousy is already working on this.
Since Sep 8, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
The message pagination endpoint accepts malformed Base64URL cursors. Appending an invalid character such as ! to a valid cursor still decodes to the original cursor and returns HTTP 200. Malformed cursors should return 400 InvalidCursorError, as session pagination already does.
Plugins
None
OpenCode version
Current dev at dff8fbc149
Steps to reproduce
- Request
/api/session/:id/message?limit=1and savecursor.next. - Request the next page with
cursor=<saved cursor>!. - Observe HTTP 200 and the same page as the unmodified cursor.
Expected: HTTP 400 with InvalidCursorError.
Screenshot and/or share link
Not applicable
Operating System
Linux x86_64
Terminal
OpenCode CLI
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.