kimi-code/packages/server/src
Haozhe 6c0ce09414
feat(server): support restoring and listing archived sessions (#1073)
* feat(server): support restoring and listing archived sessions

- add a `:restore` session action that clears the archived flag in state.json and returns the restored session
- add an `archived_only` list query param, mutually exclusive with `include_archive`, that post-filters to archived sessions
- keep the implementation in the server layer as a temporary measure until agent-core exposes restore natively

* fix(server): paginate archived-only sessions before response

* feat(web): add archived sessions page in Settings

Browse, search, filter by workspace, sort, and restore archived sessions
from a new Archived tab in Settings, backed by the server archived_only
list and :restore action.

* fix(web): keep archived Load more visible when a page filters to empty

When a search or workspace filter empties the loaded archived page, the
Load more button was hidden inside the non-empty branch, so users could
not fetch older pages to find a match. Move the button out so it stays
available whenever more archived pages exist.

* fix(server): preserve after_id bound while draining archived pages

Draining an archived_only request that starts from after_id would switch
to before_id and cross the pivot, reintroducing the pivot and older
sessions. Take a single filtered page for after_id instead of draining
past the lower bound.

* fix(server): drain archived_only within the after_id bound

An archived_only request starting from after_id now keeps paging toward
older sessions until it reaches the pivot, instead of treating the first
page as exhaustive. The loop stops as soon as it encounters the pivot
session itself, so it never reintroduces the pivot or anything older.

* feat(web): drain all archived pages for global search and sort

When the user searches, sorts, or changes the workspace filter in the
Archived settings page, fetch every remaining archived page first so the
client-side filter and sort run over the full set rather than only the
pages loaded so far.

* refactor(web): load all archived sessions upfront instead of paginating

Fetch every archived session once when the Archived settings tab opens and
drop frontend pagination entirely. Search, sort and workspace filter now run
over the full set, removing the empty-page and cursor bookkeeping that
previously caused bugs.

---------

Co-authored-by: qer <wbxl2000@outlook.com>
2026-07-06 20:09:45 +08:00
..
lib feat(server): support restoring and listing archived sessions (#1073) 2026-07-06 20:09:45 +08:00
middleware feat(server): add --dangerous-bypass-auth and --keep-alive flags (#1368) 2026-07-04 18:03:50 +08:00
openapi feat(web): introduce Kimi web app and daemon gateway (#625) 2026-06-17 20:53:46 +08:00
routes feat(server): support restoring and listing archived sessions (#1073) 2026-07-06 20:09:45 +08:00
services feat(agent-core): feed AskUserQuestion answers back as question text and option labels (#1414) 2026-07-06 16:37:54 +08:00
svc feat(server): make --host opt-in for LAN binding (#1105) 2026-06-25 22:13:13 +08:00
ws feat(web): introduce Kimi web app and daemon gateway (#625) 2026-06-17 20:53:46 +08:00
envelope.ts feat(web): introduce Kimi web app and daemon gateway (#625) 2026-06-17 20:53:46 +08:00
error-handler.ts feat(web): introduce Kimi web app and daemon gateway (#625) 2026-06-17 20:53:46 +08:00
index.ts feat(server): add bearer-token auth and safe host exposure (#1006) 2026-06-25 17:57:56 +08:00
lock.ts feat(server): add bearer-token auth and safe host exposure (#1006) 2026-06-25 17:57:56 +08:00
request-id.ts feat(web): introduce Kimi web app and daemon gateway (#625) 2026-06-17 20:53:46 +08:00
start.ts fix(session): rebuild index on boot to find missing sessions (#1390) 2026-07-05 14:06:33 +08:00
version.ts feat(server): report host kimi-code CLI version in /meta (#879) 2026-06-18 14:39:24 +08:00