Skip to main content

Module container_sessions

Module container_sessions 

Source
Expand description

The end of a container agent’s provider session (SPEC_HISTORY_COMPACT_FORM_ONLY_2026_11_23.md section 5.4).

A container agent’s session files are in its container’s volume, not on the host. The end of a session is the host path’s (transcript::provider_end::end_session: prove against the store, import what it lacks, verify, remove), run on a staged copy of the session’s two paths, with the removal done in the container by session id:

  1. the session’s files are copied out of the container into an owner-only folder of the host’s temp area;
  2. the proof and the import run on that copy, as for a host agent;
  3. when the proof has passed, the caller’s admission is taken (the agent’s lease: a running agent holds it, so its session is never touched), the container’s files are copied out a second time and must equal the first copy, and only then is <sid>.jsonl and <sid>/ removed in the container: through an exec when it runs, through a short helper container on the volume when it is stopped (ContainerManager::session_files_remove);
  4. the staged copy is overwritten and removed, and its folder with it, whatever the outcome.

Nothing here decides when a session ends or which ids AgentMux started: the caller names one session of one container. Like the host path it removes by exact session id and never lists or sweeps a folder.

Structs§

DockerHome
A container reached through the container runtime.

Traits§

ContainerHome
Where a container’s session files can be reached. Blocking, and called from a blocking thread: DockerHome is the container; a test’s is a folder.

Functions§

end_container_session
Prove, import and remove one session of a container agent: see the module’s text. read are the zones that may hold the conversation and zone is where what the store lacks is imported, as for end_session; admit is the caller’s last word, run after the proof and before anything is removed (an Err stops with nothing removed; what it returns is held until the removal is done). A session the container no longer holds is already ended: Ok with nothing counted. Every failure removes nothing, in the container or here.