Repository navigation
Closed
Labels
Description
What problem does this solve?
A graphical client needs a session list: pick a session to continue, or start a new one. The TUI has it (/resume shows the newest 50 sessions from the global index, with a label, and leaves out the current one). tole serve does not:
GET /sessionslists only sessions that are live in the server process, withidandbusyand nothing else (no name, folder or time).POST /sessions {"resume": "<id>"}can reopen a session, but only a client that already knows the id can use it. After a serve restart, or on a second device (a phone next to a desktop), no client can learn the ids of existing sessions.
So without this, a remote client can only show the sessions it created itself. Found while writing the screen inventory for #561 (screen 2, gap A). It blocks the session list on every remote client (#527, #528, #529).
Proposed solution
An index read next to GET /sessions (route name to be decided in review, for example GET /sessions?scope=all or GET /sessions/index):
- Newest first, paginated like
GET /sessions/{id}/entries(a limit with a clamp, a cursor), so a large history never turns into one huge response. - Per session:
id, a label (thefact/session_nameregister when set, otherwise the first user message, as the TUI's/resumedoes),workspace, last-activity time,liveandbusy. - Scope: only sessions under the server's own workspace (the same jail that
POST /sessions {"resume"}applies tocwd), never other folders. The token already grants prompting and approvals, but an index of the whole machine would also reveal other folders and session titles. Recommended, to be confirmed by the owner. - Read the session index (
session_index.rs) and avoid replaying every session file on each call: the existingsessions --allreplays all files per listing and has no pagination (noted in the discussion of epic: UI stack — solid core seam first, then GPUI desktop, Flutter mobile, web #523). The cost has to be bounded here, for example by reading only the index record and the last entry timestamp, or by a small cache.
Alternatives considered
- Extend
GET /sessionswith the extra fields only: no way to see sessions that are not live, which is the point of this issue. - Expose the global index of the whole machine: simplest, but widens what one token reveals.
Open question for the owner
Workspace-only scope (recommended) or the global index?
Acceptance criteria
- The new route lists sessions that are not live (after a serve restart) with name, workspace and last activity, newest first, with pagination.
- A session outside the server's workspace is never listed; covered by a test.
- A listing with thousands of sessions does not replay every session file (a bounded cost, with a test or a measured number in the PR).
- An id from the list can be passed to
POST /sessions {"resume": ...}and works. -
401without the token;docs/mobile-control.mdand the CHANGELOG are updated in the same PR.
Activity
docs: serve and acp accept --skill and --mcp-server; UI stack row fol…