Skip to contents

Serialises all turns in chat to a JSONL file under ~/.codeagent/projects/<project_hash>/<session_id>.jsonl.

Usage

save_session(
  chat,
  cwd = getwd(),
  session_id = NULL,
  title = NULL,
  assistant_text_override = NULL,
  genui_state = NULL
)

Arguments

chat

An ellmer::Chat object.

cwd

Character. Working directory (used to key the project).

session_id

Character or NULL. UUID; generated if NULL.

title

Character or NULL. Optional human-readable title.

assistant_text_override

Character or NULL. Safe finalized text for the last assistant turn's presentation line. Lossless chat-state remains intact.

genui_state

List or NULL. The generative UI canvas state to persist with the conversation, written in the same atomic file replacement as the chat state. Supplied by codeagent_app(); NULL writes no canvas line.

Value

Character(1). The session UUID.