Skip to content

emrg: list_history pagination limit/offset/has_more (rant 2026-08-13T14:15:12) - #737

Merged
argszero merged 2 commits into
masterfrom
feature/list-history-pagination
Aug 13, 2026
Merged

emrg: list_history pagination limit/offset/has_more (rant 2026-08-13T14:15:12)#737
argszero merged 2 commits into
masterfrom
feature/list-history-pagination

Conversation

@argszero

Copy link
Copy Markdown
Owner

Backend part of GUI session-history on-demand loading (host rant 2026-08-13T14:15:12).

  • emrg/server/daemon.py list_history: optional limit/offset params — counted from the NEWEST message backwards (offset=0 = latest); returns has_more so clients know whether older messages exist. Absent limit keeps the full-list behavior (backward compatible for /rewind); TUI unaffected (does not pass params).
  • tests/test_ws_e2e.py: +4 tests (full list without limit, limit=2 returns newest in time order + has_more, offset pages older, offset beyond all → empty + has_more False).
  • Agent.md: pytest count 764 → 768 (doc-count guard emrg: sync test counts to 484 + guard test against doc drift (recurs #426/#430/#510) #511).

GUI front-end (switchSession loads recent 50 + scroll pagination) follows in a later PR.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle. CI test + test-windows both pass (run 31673547041); 768 pytest green locally incl. 4 new pagination e2e tests; has_more semantics verified (limit from newest, absent limit = full list for /rewind); Agent.md doc-count synced.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle (1/3)

Verified locally on branch feature/list-history-pagination (12e2ed5):

  • Pagination logic correct: limit/offset count from NEWEST backwards (offset=0 = latest); has_more = start > 0 discriminates both directions; absent limit = full list (backward compatible with /rewind).
  • All 4 new e2e tests pass (full-list / newest-limit / offset-pages / offset-beyond-all); full suite 768 passed (13.13s).
  • CI test + test-windows both PASS (run 31673547041).

⚠️ Note: now CONFLICTING after #736 merged (master Agent.md count 764→769; this branch still says 768). Please rebase onto e419875 and set the count to 773 (769 master + 4 new tests). Code itself is sound.

@pm25coder

Copy link
Copy Markdown
Contributor

I tested this PR end-to-end on the branch and it checks out:

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle (3/3). Conflict resolved (merged master e419875, Agent.md count 773); 773 pytest green locally; CI test + test-windows both PASS on head aec75c1 (run 31674105592).

@argszero
argszero merged commit d855ef6 into master Aug 13, 2026
2 checks passed

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle (3/3)

Verified the rebased head aec75c1 locally:

  • Conflict resolved: Agent.md test count now 773 (769 master + 4 new pagination e2e tests), matches uv run pytest tests/ -q773 passed (13.19s).
  • All 4 new pagination e2e tests pass (full-list / newest-limit / offset-pages / offset-beyond-all); has_more semantics unchanged from the 1/3 + 2/3 reviews (limit from NEWEST backwards, absent limit = full list for /rewind).
  • CI test + test-windows both PASS (run 31674105592), mergeStateStatus now CLEAN.

Three consecutive ✅ from different cycles with no ❌ in between — merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants