Repository navigation
fix(app): return every loaded session from session.list_sessions - #4791
Conversation
session.list_sessions hard-coded `out.slice(0, 30)` since the original UI control bridge (#1644) even though the app already holds up to 200 sessions per workspace in memory. The action exposed no `limit` or `workspaceId` args and no truncation signal, so an agent asked to inventory ~100 sessions could not see them and fell back to scraping OpenCode storage on disk. - Return every loaded session (pinned first, then newest) by default. - Accept optional `limit` (opt-in cap) and `workspaceId` (exact id or display-name match, never falls back to another workspace). - Extract the pure listing into list-control-sessions.ts so the behavior is provable without booting Electron; keep the array result shape that the existing e2e specs consume. - Document the args in the UI control profile and cross-chat memory docs. Proof: evals/specs/session-list-sessions-inventory.test.ts (4 tests) fails 3/4 with the old cap and passes 4/4 with the fix.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
Warden review summary — ClearNative findings: 1. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (41403 ms), confidentiality-review (38047 ms), spec-provenance-review (24068 ms), desktop-den-sync-review (40954 ms). Blockers
Advisories
Needs recheck
Observed review-thread metrics
Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority. |
|
Passed · 10/10 tests · 15/15 assertions · 5 images Commit |
…name from docs
- listControlSessions now takes the raw control-action payload, so the hook's
execute is a one-line pass-through and the spec covers arg forwarding
(null / {} / positive-integer limit / trimmed workspaceId) exactly as the
control bridge delivers it (Warden 2C6-KRW).
- Replace a real-looking personal name in the public cross-chat-memory example
with a fictional topic (Warden 2T3-GM4).
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (6a61a8c9d4799e11a920e852f8a15e3754d942ca). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Problem
A session reported:
The agent could not inventory the workspace through the app's control surface and fell back to scraping OpenCode storage on disk.
Root cause
session.list_sessions(apps/app/src/react-app/domains/session/control/session-control-actions.ts) has hard-codedout.slice(0, 30)since the original UI control bridge landed in #1644. Meanwhile the app already holds the workspace's sessions in memory (listRouteSessionsnow pages exhaustively since #4783), so the data was present and simply dropped. The action exposed nolimit/workspaceIdargs and no truncation indicator, so callers had no way to know the list was partial or to ask for more.Fix
limit(opt-in cap; only a positive integer is honoured) andworkspaceId(exact id or display-name match; an unknown workspace returns[]rather than falling back to another workspace).list-control-sessions.tstaking the raw control-action payload, so the hook'sexecuteis a one-line pass-through and arg forwarding is provable without booting Electron. The result stays a plain array so the ~12 existing.e2e.test.tsspecs that consumesession.list_sessionsthrough the control API are unaffected (they also continue to exercise registration).Proof — Passed
Lane: local (PR-lane pure spec; Daytona not required for an app-less spec). Head
6a61a8c9d.Witness check — with
out.slice(0, 30)re-applied to the helper, the same spec fails3 failed | 1 passed (4).CI: all required checks green; the spec also ran in the dispatched extended lane on both runners (
✓ pr specs/session-list-sessions-inventory.test.ts (4 tests)).Pre-existing extended-lane reds (control): a
workflow_dispatchofci-tests.ymlon cleandev@586c4100f (run 34490136184) fails the same four steps with the identical 20 failing tests as this branch's run (34489353444); 0 failures are unique to this branch. Root cause there is environmental:Local Den requires MySQL on 127.0.0.1:3306(48 occurrences). Control:240 failed | 190 passedfiles,20 failed | 1801 passed; this branch:240 failed | 191 passed,20 failed | 1805 passed— the delta is exactly this spec.Claims covered by
evals/specs/session-list-sessions-inventory.test.ts(each called with the rawargspayload the control bridge delivers):nulland{}args return all 120 loaded sessions across two workspaces, newest first, no truncation.limit: 30returns exactly the 30 newest;0,2.5, and"30"are ignored.workspaceIdby id and by (trimmed) display name return the same 100 sessions; unknown workspace returns none; composes withlimit.