fix(tui): route /save through session.save JSON-RPC

The cherry-picked approach serialized the UI-shaped transcript on the Node
side, producing a third JSON format alongside cli.py save_conversation and
tui_gateway session.save. Simpler to call the existing session.save method,
which already writes the canonical agent history (raw OpenAI messages +
model) to an absolute-path file.

- /save still short-circuits before the slash worker
- Empty transcript -> 'no conversation yet'
- No active session -> 'no active session - nothing to save'
- Otherwise: rpc('session.save', {session_id}) and echo back the file path
- Tests updated to assert RPC contract; new test covers the no-sid case
This commit is contained in:
Teknium
2026-04-25 18:11:37 -07:00
committed by Teknium
parent 1b8ca9254f
commit 2536a36f6f
3 changed files with 76 additions and 88 deletions
+4
View File
@@ -119,6 +119,10 @@ export interface SessionListResponse {
sessions?: SessionListItem[]
}
export interface SessionSaveResponse {
file?: string
}
export interface SessionUndoResponse {
removed?: number
}