You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,12 +99,15 @@ remain resumable and are copied to the global location on resume. When reported
99
99
context use reaches 80% of the model's window, Kit automatically checkpoints older
100
100
history while preserving bootstrap instructions and a tool-safe recent tail; the
101
101
replacement is persisted for resume.
102
-
The session id is shown in the header. Resume it with:
102
+
The session id is shown in the header. List workspace sessions or resume one with:
103
103
104
104
```sh
105
+
cargo run -- sessions --root /path/to/project
105
106
cargo run -- tui --root /path/to/project --resume <session-id>
106
107
```
107
108
109
+
`kit sessions` prints the shared newest-first session catalog with ID, updated time, title, and preview.
110
+
108
111
A per-session filesystem lock prevents two live Kit processes from mutating the
109
112
same transcript. If a crashed process left its lock file behind, add `--force`;
110
113
Kit will reclaim it only when no live process still holds the OS lock.
@@ -583,6 +586,7 @@ child process with `KIT_RUNTIME_EVENTS=1`; other ACP hosts never see them.
583
586
| --- | --- |
584
587
|`⏎`| send |
585
588
|`/new`| start a fresh persisted session (`/new prompt` sends its first prompt) |
589
+
|`/sessions`| choose a workspace session and resume it |
586
590
|`/compact`| compact context now (`/compact prompt` starts the next turn with `prompt`) |
587
591
|`/effort`| choose `default`, `low`, `medium`, or `high`; Tab toggles saving the default |
588
592
|`/model`| open the searchable provider-grouped model picker |
@@ -607,7 +611,7 @@ no credentials — the client exits with that agent's own last diagnostic rather
607
611
than waiting on a handshake that will never finish.
608
612
609
613
`/new` clears the visible transcript but leaves the prior persisted session
610
-
intact and resumable. `/model` switches the main agent and compactor in the same
614
+
intact and resumable. `/sessions` opens the newest-first workspace catalog; Enter resumes the selected session through the same path as `/resume <session-id>`. `/model` switches the main agent and compactor in the same
611
615
live ACP session at the next safe turn boundary; it does not rewrite transcript
612
616
history or restart the child process. The picker groups models by provider and
613
617
ranks fuzzy matches as you type. Press `tab` before confirming to also replace the `provider`
The catalog requires an existing directory and is workspace-filtered and newest-first. It reports each durable ID and updated time. The title comes from the earliest retained useful user text so compaction does not rename a session; the preview describes the current retained history. Display metadata removes terminal controls and Unicode default-ignorable formatting characters.
21
+
19
22
A session ID must be 1–128 ASCII letters, digits, `-`, or `_`. `kit prompt` uses the same durable sessions: it prints `session_id: <id>` after its answer, and that ID can be continued by either `kit prompt --resume <session-id>` or `kit tui --resume <session-id>`.
20
23
21
24
## TUI keys, prompt editing, and navigation
@@ -72,12 +75,13 @@ At an idle, non-empty editor, `Ctrl+C` clears the prompt instead of unexpectedly
72
75
73
76
## Manage sessions and compact from the TUI
74
77
75
-
The TUI handles `/new`, `/resume`, `/close`, `/model`, and `/effort` as exact local slash-command tokens. It also discovers agent commands through ACP and highlights them without interpreting them locally:
78
+
The TUI handles `/new`, `/resume`, `/sessions`, `/close`, `/model`, and `/effort` as exact local slash-command tokens. It also discovers agent commands through ACP and highlights them without interpreting them locally:
76
79
77
80
```text
78
81
/new
79
82
/new Start by reviewing the tests
80
83
/resume <session-id>
84
+
/sessions
81
85
/close
82
86
/compact
83
87
/compact Continue with the migration
@@ -86,7 +90,7 @@ The TUI handles `/new`, `/resume`, `/close`, `/model`, and `/effort` as exact lo
86
90
/effort high
87
91
```
88
92
89
-
These local commands are available only while the session is idle. `/new` closes the current session and starts a fresh persisted session. It clears the visible transcript but does not delete or alter the previous session, which remains resumable by its ID. Text following `/new` becomes the new session's first prompt. `/resume <session-id>` closes the current session, resumes the requested durable session, and replays its transcript. `/close` closes the current session and exits the TUI.
93
+
These local commands are available only while the session is idle. `/new` closes the current session and starts a fresh persisted session. It clears the visible transcript but does not delete or alter the previous session, which remains resumable by its ID. Text following `/new` becomes the new session's first prompt. `/resume <session-id>` closes the current session, resumes the requested durable session, and replays its transcript; selecting the already-active ID is a no-op. `/sessions` opens a visible newest-first selector for the same workspace; Up and Down move, Enter uses the existing resume flow, and Esc closes the dialog. `/close` closes the current session and exits the TUI.
90
94
91
95
`/model` opens the model selector. `/effort` opens the advertised ACP reasoning-effort selector; `/effort default|low|medium|high` selects directly. In either dialog, Tab toggles saving the selection to `~/.kit/config.toml`, Enter selects, and Esc closes. Saving `default` removes top-level `reasoning_effort`; other values update it without replacing unrelated TOML. A new or resumed process starts from the resolved CLI/TOML default unless the selection was saved.
92
96
@@ -97,24 +101,26 @@ The ACP server advertises `compact` for every new session. The TUI submits `/com
The workspace hash is the BLAKE3 digest of the canonical workspace-root path. It keeps identical session IDs in different workspaces in separate storage directories.
110
+
105
111
Fatal error records use their own versioned JSON schema and are not transcript content. Schema v2 adds optional structured transport diagnostics; schema v1 records remain readable. Transport diagnostics contain only bounded, allowlisted request/stream stage, retry, attempt, the provider's strictly validated `x-request-id` value, reqwest classification, and typed Hyper, HTTP/2, and I/O fields. Unknown or truncated source chains are identified without storing source text. Kit never stores raw error display/debug text, arbitrary headers, prompts, tool arguments, response bodies, credentials, URLs, or peer-controlled HTTP/2 debug text in these records. Files are written atomically with owner-only permissions on Unix, and Kit retains the newest 50 records per session. Cancellation is not a fatal error and does not create a record. When persistence succeeds, local prompt and ACP terminal errors include the log path; A2A records stay server-local.
106
112
107
113
`HOME is unset; cannot locate durable sessions` means Kit cannot determine this directory. Set `HOME` to the intended home directory before starting Kit.
108
114
109
115
Transcript records are versioned and have consecutive generations. Transcript schema v3 records the canonical workspace root so ACP discovery and resume cannot expose a session to another project; schema v1 and v2 records remain readable and gain that binding when they are next resumed. Normal items are appended and synced to disk before they are accepted into the in-memory conversation. Operations such as compaction append a replacement record; older records remain in the JSONL file, but readers treat the latest valid replacement as the canonical transcript.
110
116
111
-
Older sessions under `<root>/.kit/sessions` remain readable. The first resume validates and copies a legacy transcript into `~/.kit/sessions`; a live legacy lock produces `legacy session is actively locked by another Kit instance ...; stop it before resuming with this Kit version`. When both locations contain the ID, the global transcript is preferred.
117
+
Older sessions stored directly under `~/.kit/sessions` or under `<root>/.kit/sessions` remain readable. On resume, Kit compares workspace-hashed, workspace-bound global, and project-local candidates and selects the history that descends from the others; equivalent histories prefer the workspace-hashed copy, while divergent histories fail instead of choosing silently. An old global transcript without workspace metadata is a fallback only for an explicit resume when no workspace-hashed or project-local candidate has that ID. The first successful resume copies the authoritative history into the workspace-hashed directory and leaves redirects in applicable legacy files. A live legacy lock produces `legacy session is actively locked by another Kit instance ...; stop it before resuming with this Kit version`.
112
118
113
119
### ACP session loading
114
120
115
-
ACP v1 clients restore a closed durable session with `session/load`. The v1 endpoint advertises only the protocol's top-level `loadSession` capability; it does not advertise`session/resume` or`session/list`. ACP v2 clients use `session/list`and `session/resume` instead. Both versions use the exact durable session ID and return the same model and reasoning configuration options as `session/new`.
121
+
ACP v1 clients restore a closed durable session with `session/load` and discover sessions with the optional `session/list` capability. ACP v2 clients use`session/list` and`session/resume`. Both list variants use the same newest-first catalog, optional exact-cwd filter, and opaque `offset:<n>` pagination cursors, and return titles and RFC 3339 updated times. Both versions use the exact durable session ID and return the same model and reasoning configuration options as `session/new`.
116
122
117
-
Session discovery and restoration are isolated to the server's canonical workspace root. A requested workspace must match that root, and additional directories are not accepted. Legacy transcripts under a project-local `.kit/sessions` directory follow the same migration and root checks as CLI resume; they do not make a same-named session visible from another workspace.
123
+
Session discovery and restoration are isolated to the server's canonical workspace root. A requested workspace must match that root, and additional directories are not accepted. Legacy transcripts under a project-local `.kit/sessions` directory follow the same migration and root checks as CLI resume; they do not make a same-named session visible from another workspace. Old global transcripts without workspace metadata are excluded from discovery in every workspace, but an explicit resume by ID remains supported and binds the transcript to that workspace. An individually malformed or concurrently incomplete transcript is omitted from catalog results without preventing valid sessions from being listed; explicit resume remains strict and reports its error.
118
124
119
125
An arbitrary ACP load or resume never applies the server process's configured `--force` setting. The one exception is the initial resume requested by `kit tui --resume <id> --force`: only that matching configured session may use the explicit stale-lock override. If another live Kit instance owns the session lock, restoration fails instead of taking over the session. A missing or invalid ID also fails normally. After the session closes and releases its lock, an ACP client can restore it again.
0 commit comments