[GH-ISSUE #1525] [Issue]: Long-Term Memory: two browser regression checks read the page before its request finishes #1506

Closed
opened 2026-10-22 04:02:47 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Oct 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1525

Originally assigned to: @Promansis on GitHub.

Summary

The Long-Term Memory browser suite fails now and then on a slow or busy machine. Two of its assertions read the page right after a surface appears, before the request that fills it has answered: the setup guide depends on /status, and the "Currently viewing memories in" place depends on /scope-targets. When the response is late, the assertion sees the loading state and fails. The product behaves correctly in both cases; only the test is early. A third check with the same race, the vault health pill, was fixed in #1521.

Another intermittent failure in the same suite, 5 !== 4 availability pills after a bulk "Remove availability", is a product bug and is not covered here: a memory opened while a bulk change is still running shows, and can save back, its old availability.

Affected package

long-term-memory 1.4.66 (measured on 1.4.55), browser regression suite only (tests/long-term-memory-browser.regression.ts). No package code changes.

Expected behavior

Each assertion waits for the request it depends on, so the suite passes however long /status or /scope-targets takes (within the 30 s default wait), and still fails when the result is wrong: after the 30 s default wait for a guide that does not reopen or a place other than the current chat.

Actual behavior

On staging 8b72729f1:

  1. Setup guide (:6306; :6526 on 1.4.66): after a reload mid-guide the test checks that the guide is open right after the detail surface appears. The guide reopens at its saved step only once /status has loaded (Onboarding.tsx, ready = status.isSuccess), so the check reads 0 !== 1.
  2. Vault place (:1769; :1772 on 1.4.66): right after the place picker appears the test reads "Currently viewing memories in: Current". Until /scope-targets answers, the vault has no place yet and the picker shows "All" (MemoryVault.tsx, value={target?.id ?? "all"}), so the check fails with 'Currently viewing memories in:\nAll'.

In 23 measured runs of the suite (8 on an idle machine, 15 with 12 CPU burners), the guide check failed twice under load (the pill check, since fixed, failed twice too). The place check was not seen in those runs; it failed twice later on the same busy machine.

Steps to reproduce

  1. In a copy of the browser test, delay the /status response once before the reload at step 1, for example with page.route("**/api/long-term-memory/status", async (route) => { await new Promise((resolve) => setTimeout(resolve, 1500)); await route.continue(); }, { times: 1 }).
  2. Run the suite: it fails at the guide check every time (0 !== 1).
  3. Delay the first /scope-targets?… response the same way before the first page load: the suite fails at the place check every time.

Minimal fix

One PR, test only, no version bump or changelog entry.

  • Guide: replace the count with await firstRunPage.locator('[data-ltm-surface="onboarding"]').waitFor();.
  • Place: before the text check, wait for the picker to show the current chat: await memoryScopeTrigger.getByText("Current", { exact: true }).waitFor();. The existing text check stays.

Regression proof

A throwaway copy of the test delays the response by 1.5 s with page.route (not part of the patch):

  • /status delayed, pill wait only (as on staging since #1521): fails at the guide (0 !== 1).
  • /scope-targets delayed, no place wait: fails at the place (…\nAll). A trace shows the picker reads "All" at 0 s and 1 s and "Current" at 3 s.
  • Both delays with the pill wait and both new waits: passes.

Environment

  • Marinara Engine version: 2.5.0 line (staging 2039583ca)
  • Package version: long-term-memory 1.4.55 (upstream/staging 8b72729f1); still present on 1.4.66 (77acb942b)
  • Install type: source (local browser suite)
  • OS + version: Linux 6.8 (Ubuntu); not platform-specific
  • Browser or app shell: Playwright Chromium (the suite's own)

Logs, screenshots, or video

AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:

0 !== 1
AssertionError [ERR_ASSERTION]: The input did not match the regular expression /^Currently viewing memories in:\s*Current\b/u. Input:

'Currently viewing memories in:\nAll'

Additional context

Tracker item OT-8.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Oct 21, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1525 Originally assigned to: @Promansis on GitHub. ## Summary The Long-Term Memory browser suite fails now and then on a slow or busy machine. Two of its assertions read the page right after a surface appears, before the request that fills it has answered: the setup guide depends on `/status`, and the "Currently viewing memories in" place depends on `/scope-targets`. When the response is late, the assertion sees the loading state and fails. The product behaves correctly in both cases; only the test is early. A third check with the same race, the vault health pill, was fixed in #1521. Another intermittent failure in the same suite, `5 !== 4` availability pills after a bulk "Remove availability", is a product bug and is not covered here: a memory opened while a bulk change is still running shows, and can save back, its old availability. ## Affected package `long-term-memory` 1.4.66 (measured on 1.4.55), browser regression suite only (`tests/long-term-memory-browser.regression.ts`). No package code changes. ## Expected behavior Each assertion waits for the request it depends on, so the suite passes however long `/status` or `/scope-targets` takes (within the 30 s default wait), and still fails when the result is wrong: after the 30 s default wait for a guide that does not reopen or a place other than the current chat. ## Actual behavior On `staging` 8b72729f1: 1. **Setup guide** (`:6306`; `:6526` on 1.4.66): after a reload mid-guide the test checks that the guide is open right after the detail surface appears. The guide reopens at its saved step only once `/status` has loaded (`Onboarding.tsx`, `ready = status.isSuccess`), so the check reads `0 !== 1`. 2. **Vault place** (`:1769`; `:1772` on 1.4.66): right after the place picker appears the test reads "Currently viewing memories in: Current". Until `/scope-targets` answers, the vault has no place yet and the picker shows "All" (`MemoryVault.tsx`, `value={target?.id ?? "all"}`), so the check fails with `'Currently viewing memories in:\nAll'`. In 23 measured runs of the suite (8 on an idle machine, 15 with 12 CPU burners), the guide check failed twice under load (the pill check, since fixed, failed twice too). The place check was not seen in those runs; it failed twice later on the same busy machine. ## Steps to reproduce 1. In a copy of the browser test, delay the `/status` response once before the reload at step 1, for example with `page.route("**/api/long-term-memory/status", async (route) => { await new Promise((resolve) => setTimeout(resolve, 1500)); await route.continue(); }, { times: 1 })`. 2. Run the suite: it fails at the guide check every time (`0 !== 1`). 3. Delay the first `/scope-targets?…` response the same way before the first page load: the suite fails at the place check every time. ## Minimal fix One PR, test only, no version bump or changelog entry. - Guide: replace the count with `await firstRunPage.locator('[data-ltm-surface="onboarding"]').waitFor();`. - Place: before the text check, wait for the picker to show the current chat: `await memoryScopeTrigger.getByText("Current", { exact: true }).waitFor();`. The existing text check stays. ## Regression proof A throwaway copy of the test delays the response by 1.5 s with `page.route` (not part of the patch): - `/status` delayed, pill wait only (as on staging since #1521): fails at the guide (`0 !== 1`). - `/scope-targets` delayed, no place wait: fails at the place (`…\nAll`). A trace shows the picker reads "All" at 0 s and 1 s and "Current" at 3 s. - Both delays with the pill wait and both new waits: passes. ## Environment - Marinara Engine version: 2.5.0 line (`staging` 2039583ca) - Package version: long-term-memory 1.4.55 (`upstream/staging` 8b72729f1); still present on 1.4.66 (77acb942b) - Install type: source (local browser suite) - OS + version: Linux 6.8 (Ubuntu); not platform-specific - Browser or app shell: Playwright Chromium (the suite's own) ## Logs, screenshots, or video ``` AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: 0 !== 1 ``` ``` AssertionError [ERR_ASSERTION]: The input did not match the regular expression /^Currently viewing memories in:\s*Current\b/u. Input: 'Currently viewing memories in:\nAll' ``` ## Additional context Tracker item OT-8. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-22 04:02:47 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#1506
No description provided.