|
chat history pagination: paged load instead of full-session fetch
Backend:
- PgSessionStore.get_meta — light session head (sessions row + COUNT),
no message payload
- PgSessionStore.get_history_page — page of display history (archive ∪
hot UNION), newest-first page, oldest-first result, limit+1 peek for
has_more; each message stamped metadata.display_index (ROW_NUMBER-1
over the full display history) so client ids stay stable across
paged loads; dangling-tool-call repair keeps real ranks by
sequence-number lookup
- GET /sessions/{id}/meta and GET /sessions/{id}/messages/history
(before_seq cursor, limit ≤200)
Webclient:
- loadSession/reloadSession fetch meta + newest 200-item page
(Promise.all), archive state from the page itself
- buildMessageList ids (h_*) and rawIndices use the global
display_index — feedback keys and search-jump stay stable when
history is paged
- scroll-up loads older pages through the same history endpoint
(archive table alone misses sessions whose threshold never moved)
- search-jump pulls pages until the target index is covered (bounded)
Tests: store unit tests (ranks, has_more peek, placeholder shift) +
vitest updates; full pytest 1231 passed, vitest 94 passed.
|
|---|
|
|
| navi/api/routes/sessions.py |
|---|
| navi/core/pg_session_store.py |
|---|
| tests/unit/core/test_pg_session_store.py |
|---|
| webclient/dist/assets/index-BEctUJ4R.js 0 → 100644 |
|---|
|
Not supported
|
| webclient/dist/assets/index-CFZ4CERY.js 100644 → 0 |
|---|
|
Not supported
|
| webclient/dist/assets/index-CVywHeX3.css 100644 → 0 |
|---|
| webclient/dist/assets/index-CfD2dcHA.css 0 → 100644 |
|---|
| webclient/dist/index.html |
|---|
| webclient/dist/sw.js |
|---|
| webclient/src/api/index.js |
|---|
| webclient/src/stores/chat.js |
|---|
| webclient/tests/unit/stores/chat.test.js |
|---|