Skip to content

fix(memos-local-plugin): hide pager when filter empties tasks list#1714

Merged
syzsunshine219 merged 1 commit into
mem-agent-0512from
bug/tasks-pager-empty-state-magent
May 12, 2026
Merged

fix(memos-local-plugin): hide pager when filter empties tasks list#1714
syzsunshine219 merged 1 commit into
mem-agent-0512from
bug/tasks-pager-empty-state-magent

Conversation

@syzsunshine219
Copy link
Copy Markdown
Collaborator

Summary

Bug fix for v2 viewer Tasks page: when status filter (all / enabled / done / skipped / failed) yields no rows, the pager kept rendering with full-dataset total/hasMore, misleading users.

Root cause

  • /api/v1/episodes did not accept a status filter, so total/hasMore were always full count.
  • TasksView.tsx only filtered the current 20 rows on the client, and the pager rendered based on (page > 0 || hasMore) — independent of filtered length.

Fix

  • Server: shared deriveStatus + parseTaskStatusFilter (agent-contract/episode-status.ts), GET /api/v1/episodes now supports status query.
  • Web: send status/q to server, debounce, drop client-side filter, hide pager when filtered.length === 0.
  • i18n: add tasks.empty.filtered (zh/en).
  • Tests: 11 episode-status unit cases + 4 server route cases (status filter, pagination, garbage tolerance, status+q combo).

Note

Branch was originally cut from mem-agent-0509-magent. Now landing on mem-agent-0512 (which already contains 0509 + 0509-magent merges).

Test plan

  • npm run lint passes
  • new unit cases pass on this branch
  • full regression after deploy of 2.0.0-beta.13

Made with Cursor

When users filter the v2 viewer tasks page by status (all/enabled/done/skipped/failed),
the empty state was shown but the pager kept rendering against full-dataset total/hasMore,
which misleads users into thinking "there is data on other pages".

Root cause:
- /api/v1/episodes did not accept a `status` filter, so total/hasMore were always
  computed against the full session count.
- TasksView.tsx only filtered the current 20 rows on the client and rendered the
  pager based on (page > 0 || hasMore), independent of the filtered length.

Fix:
- Server: introduce shared deriveStatus + parseTaskStatusFilter (agent-contract/episode-status.ts)
  and add `status` query support to GET /api/v1/episodes; total/hasMore now reflect the
  filtered set, with q + status combinable.
- Web: send status/q to the server, debounce + add deps to the loader effect, drop the
  client-side filter, and add a `filtered.length === 0` guard so the pager hides under
  any active filter that yields no rows.
- i18n: new tasks.empty.filtered string (zh/en).
- Tests: 11 unit cases for episode-status derivation + 4 server route cases covering
  status filter, pagination, garbage tolerance, and status+q combinations.

Co-authored-by: Cursor <cursoragent@cursor.com>
@syzsunshine219 syzsunshine219 merged commit 7b80026 into mem-agent-0512 May 12, 2026
hijzy added a commit that referenced this pull request May 13, 2026
## Summary

Merge the `mem-agent-0512` integration branch into `main`. This branch
consolidates three lines of work that have been individually PR-reviewed
and tested:

- **PR #1712** — `mem-agent-0509` (namespace visibility, Windows
installer, telemetry, bug fixes)
- **PR #1713** — `mem-agent-0509-magent` (multi-agent owner filtering,
NamespaceSelect component)
- **PR #1714** — `bug/tasks-pager-empty-state-magent` (tasks list pager
bug fix)

Published as **`@memtensor/memos-local-plugin@2.0.1`** (npm `latest`).

## Highlights

### Features
- **Namespace visibility isolation** — `visibilityWhere` SQL +
`visibleToCurrent` in-memory filtering
- **Multi-agent owner filtering** — `ownerAgentKind` / `ownerProfileId`
fields, `includeAllNamespaces` escape hatch
- **NamespaceSelect viewer component** — dropdown to filter
Memories/Policies/Skills/WorldModels by agent namespace
- **Windows installer** — auto-detection, interactive UI, improved
Hermes path/encoding/log handling
- **Embedding dimension auto-inference** — no longer requires manual
specification on rebuilds

### Bug fixes
- fix: hide pager when status filter empties tasks list (server-side
status filter on `/api/v1/episodes`)
- fix: preserve OpenClaw memory context
- fix: reward score always negative
- fix: ghost overview memory
- fix: fix namespace
- fix: improve Windows bridge launch
- fix: close v2 ARMS telemetry coverage gaps
- fix: harden multi-agent memory handling

### Engineering
- chore: rename `web/` to `viewer/`, drop unused `site/` scaffolding
- chore: gitignore telemetry.credentials.json
- Shared `agent-contract/episode-status.ts` for status derivation

## Test results (mem-agent-0512 branch)

| Suite | Passed | Failed | Skipped |
|-------|--------|--------|---------|
| Contracts (API structure) | 70 | 0 | 0 |
| Scenarios (business intent) | 469 | 0 | 36 |
| **Total** | **539** | **0** | **36** |

Plugin unit tests: 111 passed / 8 failed (all 8 are pre-existing
failures from upstream 0509/0509-magent, 0 regressions introduced).

## Stats

187 files changed, +5714 / −2178 lines

## Test plan

- [x] `npm run lint` passes
- [x] `npm run test:unit` — 0 new failures vs baseline
- [x] Intent-driven contracts: 70/70 pass (hermes + openclaw dual-agent)
- [x] Intent-driven scenarios: 469/469 pass
- [x] npm publish `@memtensor/memos-local-plugin@2.0.1` verified on
registry
- [ ] Reviewer sign-off
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.

1 participant