Skip to content

fix(ui): let the memory page reach every memory, not the first 200 - #7312

Merged
kovtcharov-amd merged 4 commits into
amd:mainfrom
kovtcharov:kalin/rc18-memory-page-all
Nov 12, 2026
Merged

kovtcharov-amd merged 4 commits into
amd:mainfrom
kovtcharov:kalin/rc18-memory-page-all

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

With more than 200 memories, Memory > About you listed the 200 newest and
stopped, with no count and no way to the rest, so those memories could not
be reviewed or forgotten in the app although GAIA still used them. The
page now says how many there are ("Showing 200 of 323 memories") and Show
more lists the next 200.

The list loads page by page within the endpoint's 200-row limit and
reloads as many rows as are open after an edit, add or undo. The new
strings have English and Arabic entries, and a visual state covers them.

Closes #7287

Test plan

  • npx vitest run src/components/__tests__/MemoryDashboard (57 pass), npx tsc --noEmit -p .
  • Looked at the new count and Show more button in English and Arabic screenshots
  • Rebuilt app with 300+ memories: Show more reaches every memory

With more than 200 memories, Memory > About you listed the 200 newest and
stopped, with no count and no way to the rest, so those memories could not
be reviewed or forgotten in the app although GAIA still used them. The
page now says how many there are ("Showing 200 of 323 memories") and Show
more lists the next 200.

The list loads page by page within the endpoint's 200-row limit and
reloads as many rows as are open after an edit, add or undo. The new
strings have English and Arabic entries, and a visual state covers them.

Closes #ISSUE
@github-actions github-actions Bot added documentation Documentation changes electron Electron app changes labels Nov 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions

With more than 200 memories, Memory › About you now says how many there are and Show more lists the next 200, so every memory can be reviewed and forgotten in the app. The paging logic is correct: the server filters and counts in the database, and its sort order has a tie-break, so pages don't overlap or skip rows. After an edit, add or undo, the list reloads as many rows as were open. Tests cover both the count and the "forget a row past 200" case.

  • No screenshot on the PR. The test plan says the English and Arabic screenshots were checked, but none are embedded, and the rebuilt-app check with 300+ memories is still unticked. Please add the about-more screenshots (en + ar) to the description, or tick the real-app item. This isn't blocking.

Real-world evidence

N/A: no evidence bundle was produced for this run. The change is Agent UI only, and the rendered check is deferred to the strix-halo lane. The verdict rests on static review plus the PR's unit tests and visual-test state.

🔍 Technical details

Issues

🟡 UI change without embedded screenshot evidence. Per the rubric, an Agent UI change should show a before→after screenshot in the PR body. The new rtl.visual.ts state about-more already produces one, so embedding about-more for en and ar would close this.

🟢 A write between page fetches can duplicate a row (MemoryDashboardAboutYou.tsx:111-127). Pages are fetched one after another by offset. If the agent saves or edits a memory between page 1 and page 2 (it re-sorts to the top by updated_at), every row shifts down one. The last row of page 1 then comes back again at the start of page 2. That gives a duplicate key and one row shown twice until the next reload. This is rare, but a cheap guard is to dedupe by id when appending:

                const seen = new Set(rows.map(r => r.id));
                rows.push(...(data.items as AboutYouItem[]).filter(r => !seen.has(r.id)));

(The short-page and found break conditions still terminate correctly with this, because count bounds the loop.)

Checked, no issue

  • The backend accepts offset, and limit is capped at le=200 (ui/routers/memory.py:352-353). PAGE_SIZE matches that cap, and the test asserts no request exceeds 200.
  • total is counted by SQL with the same about_user filter as the rows (memory_store.py, get_all_knowledge). The ORDER BY … , k.rowid tie-break keeps page boundaries stable.
  • The loop always terminates: on a short page, or when rows ≥ min(count, total). The visual fixture returns the same short page for every offset, and the loop exits after one call.
  • Docs: the new memory guide line matches the behaviour. I grepped for an old "200" claim and found no stale one.

Strengths

  • Reloads keep the pages that are already open (wanted ref). Forgetting row 240 doesn't collapse the list back to 200, and a test covers it.
  • The new strings go through t() with Arabic entries, and an RTL visual state covers both locales.

A memory saved while the About you list loaded its pages shifted every row
down one, so the row at the page edge came back on the next page and showed
twice. Pages now continue from the rows actually read and skip an id
already listed.
@kovtcharov

Copy link
Copy Markdown
Contributor Author

A memory saved while the list loads no longer shows a row twice (98ccf60).

  • Duplicate row between pages: each page now starts after the rows actually read, and a row whose id is already listed is skipped. New test: a memory is saved between page 1 and page 2, and the row at the page edge shows once.
  • Not done here: the en/ar about-more screenshots and the rebuilt-app check with 300+ memories. They need a person at the app and a privacy look at the images before posting, so they stay with the maintainer.

The branch already contained current main, so there was nothing to merge in.

Show more then Add reloads the About you list; this pins that the reload
reads the second page again instead of collapsing back to the first 200.
The dashboard bumps the About you reload key when its first full load
finishes. If that landed while Show more was fetching, the reload read the
old row count and superseded the fetch, so the list stayed at 200 and Show
more seemed to do nothing. Show more now records the larger count before it
loads, so any reload that starts mid-way fetches the new page as well. This
was the intermittent 'Memory number 249' timeout in the Vitest job.
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Show more could do nothing when the dashboard's own reload landed while it was fetching: the list stayed at 200. That's fixed now, and it was the intermittent Vitest failure on this PR.

  • The reload read the old row count and replaced the Show more fetch. Show more now records the larger count first, so a reload that starts mid-way fetches the new page too.
  • Added two tests: a reload during Show more still shows page 2 (fails without the fix with the same 10s timeout CI hit), and an add after Show more keeps the second page (carried over from fix(webui): page past the first 200 memories on About you #7303, which duplicates this PR).
🔍 Technical details

MemoryDashboard.loadAll bumps aboutReloadKey after its Promise.all resolves. showMore passed the new count to load(want) but wanted.current was only updated at the end of a successful load, so the effect-triggered load() used 200 and bumped generation, which made the Show more load bail. showMore now sets wanted.current before calling load(). Commits f80fa68 and b39cf70.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Nov 12, 2026
Merged via the queue into amd:main with commit 5aa6dce Nov 12, 2026
84 of 85 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the kalin/rc18-memory-page-all branch November 12, 2026 07:44
kovtcharov-amd added a commit to kovtcharov/gaia that referenced this pull request Nov 12, 2026
Every unit test indexes three files and stores five memories, and rc18
fell over at 300 of each: a folder index reloaded the embedder once per
file, so 300 small files took 15 minutes, and a memory search over a few
hundred rows ended the turn on a JSON error. This adds a scale run that
does both at a real user's size on every release tag, with no model: the
installer journeys' fake model server answers, and the test asserts
counts of what GAIA asked it for.

What it asserts:

| At scale | Assertion | Today |
|---|---|---|
| large folder index | every file indexed, exactly one library row each
| ✅ |
| large folder index | the embedder is loaded at most twice, within a
time budget | ✅ (fixed by amd#7310 while this was in review; it caught
amd#7288, a reload per file, before that) |
| search over 500 memories | the result can be sent as JSON | ✅ (fixed
by amd#7308 while this was in review; the test caught it before that) |
| 500 memories | the memory API reaches every one, page by page | ✅ |

**Size:** 300 files, the size rc18 failed at. With amd#7310 in, they index
in about 25 s against the fake server, well inside the 240 s budget;
before it, 300 ran past 45 minutes on a hosted runner (that slowness was
the bug).

**Not built here, and why:** the 60-turn chat with the context meter
compared to what the model is sent (F59) needs a real flagship turn loop
behind the relay, and the memory page showing only 200 of 500 (F63) and
duplicate rows from a re-add during indexing (F65) are a frontend bug
and a race. Each has its own focused test in its fix PR (amd#7309, amd#7312,
amd#7311); a scale version belongs with the Electron journey proposed in
amd#7343.

Stacked on amd#7331 (it uses that PR's `tests/fixtures/fake_lemonade.py`);
the commits before "test: run GAIA at a real user's size ..." are that
PR.

## Test plan

- [ ] The new **Scale Run** workflow on this PR passes (4 passed)
- [ ] Locally: `GAIA_SCALE_FILES=8 python -m pytest
tests/integration/test_scale_run.py -q` passes
- [ ] Runs on every `v*` tag (each RC and final) and on PRs that touch
the test, its fixture or the workflow

<details>
<summary>🔍 Technical details</summary>

- The folder is indexed once per run through `POST
/api/documents/index-folder` with the real RAG code; the embedder's load
and unload requests are read from the fake server's log.
- The time budget (240 s) sits in the same expected-failure test as the
load count, since the reloads are what make it slow.
</details>

---------

Co-authored-by: Kalin Ovtcharov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation changes electron Electron app changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory page shows only the first 200 memories

2 participants