Skip to content

feat(discord): recovery cursor correctness - #86547

Closed
andrexibiza wants to merge 1 commit into
NousResearch:mainfrom
andrexibiza:feat/discord-recovery-cursor
Closed

andrexibiza wants to merge 1 commit into
NousResearch:mainfrom
andrexibiza:feat/discord-recovery-cursor

Conversation

@andrexibiza

@andrexibiza andrexibiza commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Recovery cursor correctness for Discord history backfill — monotonic per-channel cursors, backward-move rejection, and per-channel dedup.

Motivation

Fixes #86539 · Part of #79564

Changes

  • New module plugins/platforms/discord/recovery_cursor.py implementing monotonic cursor advance, per-channel dedup, and cursor_for.

Test Plan

  • Unit tests pass (pytest)
  • Focused regression tests: tests/tools/test_discord_recovery_cursor.py — 21 passed
  • Manual testing of new functionality
  • No regressions in existing behavior

Notes for Reviewers

  • New module only — no god-file growth; plugins/platforms/discord/adapter.py untouched.

Add plugins/platforms/discord/recovery_cursor.py — Discord recovery-cursor
correctness (monotonic advance, per-channel dedup, cursor_for). Pure logic.
New module only — no god-file growth. Part of NousResearch#79564.
@alt-glitch alt-glitch added type/feature New feature or request comp/plugins Plugin system and bundled plugins platform/discord Discord bot adapter P3 Low — cosmetic, nice to have labels Aug 15, 2026
@Adolanium

Copy link
Copy Markdown
Contributor

This does not fix Discord recovery. Nothing in the running adapter imports this file.

The real cursor is already in adapter.py and recovery.py. It lives in SQLite (discord_recovery_cursors), is read as after= on history fetch, and only advances after a message is actually completed. That is the path that drains missed chat after a restart.

Your module is an in-memory dict. It dies when the process dies. Recovery is the thing that has to survive that. advance() also jumps to the max id in a batch even if those messages were never handled. Wired in, that would skip work. It is not wired in.

The 21 tests only construct RecoveryCursorManager and poke it. They never touch Discord, the DB, or a restart.

#86539 is not a bug report. You opened it 46 seconds before this PR. The body is "21 tests pass" and a campaign tag.

"New module only / no god-file growth" means you avoided the only file that would have to change for this to matter. Plus the email map again.

Close it. If recovery cursor correctness is a real bug, show a missed-message repro on the existing SQLite path and patch that.

@andrexibiza andrexibiza changed the title feat(discord): recovery cursor correctness (omniscience R3) feat(discord): recovery cursor correctness Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have platform/discord Discord bot adapter type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discord R3: recovery cursor correctness

3 participants