Repository navigation
Conversation
…espace Pinned, Conflicted and Verified read the newest 1,000 rows and kept the matching ones, so in a larger namespace an older pinned or conflicted memory was missing and the count was wrong. memory.list takes pinned_only (hidden from the MCP listing), passed to the recency and score reads, both counts and the count cache key. Conflicted reads the conflicted keys and their rows with memory.bulk_get, 1,000 keys at a time, and says when the keys read reach the 5,000-key cap. Verified is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: dilipna <163414135+dilipna@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
zlareb1
left a comment
There was a problem hiding this comment.
One reproduced identity regression remains in the Conflicted filter. The 25 submitted list tests and 120 MCP listing tests pass; a same-key, two-agent regression fails on this head and passes with the prior list implementation.
| return { | ||
| entries, | ||
| truncated: keys.length >= CONFLICT_KEYS_CAP, | ||
| total: entries.length, |
There was a problem hiding this comment.
P2 — Preserve the identity of the conflicted row. conflicts.list(keys_only=true) returns only keys, while wildcard memory.bulk_get chooses the newest row per key (reads.py uses LIMIT 1 BY memory_key). If agent A has an older conflicted shared-key and agent B has a newer active shared-key, selecting Conflicted drops A and displays B as conflicted. A component regression with those two list entries, conflict keys ["shared-key"], and the bulk answer for B fails here and passes with the prior implementation. Read the conflict rows by their ids or full identities so another agent cannot replace the row being listed; cover this case in a regression test.
Related: #719
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
On the Memories page, Pinned and Conflicted now cover the whole namespace: Pinned is filtered on the server (
memory.listtakespinned_only), and Conflicted reads every conflicted row by key, so a pinned or conflicted memory older than the newest 1,000 rows is listed and counted.Why
Pinned, Conflicted and Verified read the newest 1,000 rows and kept the matching ones in the browser. In a namespace with more than 1,000 live memories, a pinned or conflicted memory older than those rows was not listed, and the count only covered the matches among them (#719), against the dashboard design guide's rule that a filter covers what the server holds or says what it covers.
The store already had a pinned filter (
pinned_onlyonlist_by_namespaceandcount_by_namespace);memory.listdid not expose it. For Conflicted, the page already read the conflicted keys withconflicts.list(keys_only) for the cards' chips, so it now reads those rows by key withmemory.bulk_getinstead of filtering the newest rows.This PR does not close #719: Verified is unchanged, pending the question in the issue (#719 (comment)). It can follow here or in a second PR, whichever you prefer.
Scope and risk
server/memory/api/models_crud.py:MemoryListInput.pinned_only(default off,MCP_HIDDENlikecontainsandtags_every).server/memory/app/query.py:pinned_onlyreaches the recency read, both counts (totalandtoday), the hidden-under-prefix count, and the score path (sort_by="score"), and it is part of the count cache key so a filtered count is not served from an unfiltered entry. The per-type quota trim in_list_by_scoremoved into_within_quotasunchanged, because the extra filter took that function over the function-length gate's 50 statements.frontend/src/views/memoryListReads.ts: Pinned sendspinned_only. Conflicted reads the keys withconflicts.listand the rows withmemory.bulk_getin batches of 1,000 (memory_keyscaps a call at 1,000). Thememory.listread before it asks for one row, so the 8 s poll still stops at an unchangednamespace_version. Agent and tag filters stay on the page for Conflicted, over the complete set.frontend/src/views/Recent.tsx: the count uses the server's total for a Pinned read the server filtered, as it does for a tag or agent filter. The note under the toolbar says "the newest matches" for a cut-short Pinned read, and "the memories of the newest 5,000 conflicted keys" when the keys read reachconflicted_keys' cap of 5,000. Verified keeps the old note.On the 5,000-key cap: I first paged
conflicted_keyswith thebefore_versionkeyset thatlist_conflicteduses, and dropped it. Memory versions aretime.time_ns()values (about 1.7e18), above 2^53, so a cursor read back by the dashboard as a JSON number is rounded to a multiple of 256 (JSON.parse("1763500000123456789")is1763500000123456800). Withversion < cursor, a cursor rounded up repeats the page's last key, and one rounded down skips any key whose version falls in the gap. The issue offered the note as the other option, so this PR takes it. The same rounding applies to the review queue's row cursor (listConflicts,next_before_version), which I have not changed or tested here; I can open a separate issue if useful.Compatibility, rollout and rollback
memory.listaddspinned_only(bool, defaultfalse, hidden from the MCP listing). Nothing changed or removed.pinned_onlyinignored_argsand lists every row; the page then keeps the pinned rows among the newest it read and counts them itself, as before. Conflicted uses only existing ops and fields.Tests
Head
84651b178, on Linux (Python 3.12, Node 22.13), ClickHouselateststarted with the CI config mounts (dev/ci_start_clickhouse.sh's volumes), server from source with the integration job's environment.make format-check(shfmt v3.10.0, as CI pins),make lint,make typecheck: exit 0. The generators (sdk_py_gen,sdk_py_client_gen,sdk_ts_gen,docs_reference,op_reach_census) with--check: current.npm --prefix frontend run test: exit 0, 317 files, 3715 tests passed. (A run started beside the integration server timed out 55 tests across unrelated components; alone, every test passes.)npm --prefix frontend run buildandnpm --prefix frontend run budget: exit 0.Recent.lists.test.tsx: Pinned sendspinned_onlyand counts from the server's total; a server that namespinned_onlyinignored_argskeeps the pinned rows among those read; Conflicted lists a key that is not among the newest rows with 1,500 conflicted keys, read as twomemory.bulk_getbatches (1,000 and 500); 5,000 keys show the cap note. Two existing tests that picked Pinned against a mock returning unfiltered rows now pick Verified, the status they describe (kept among the rows read).pytest tests/integration/test_memory_delete_list.pyagainst the server: exit 0, 12 passed. The newtest_list_pinned_only_reaches_past_the_rows_readfails on a server built frommain(memory.listignorespinned_onlyand returns the three newest rows) and passed 5 runs in a row on this branch. Its pinned row is written first under a key that sorts last, because the list orders bycreated_atin whole seconds and then by key.tests/unitthat namememory.list,MemoryListInput, the score path, quotas orMCP_HIDDEN, plustest_public_copy.pyandtest_mcp_listing_budget.py: exit 0, 3281 passed, 20 skipped (on the base before the last rebase, which applied without conflicts).Not run locally: the full unit suite and the full integration suite (left to CI, as
AGENTS.mdsays), Playwright e2e, Postgres memory authority.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. I read the paths it changed, checked the design against the issue and the existing ops, and ran every gate listed above myself.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py).main; no merged migration is edited.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.