Skip to main content

Module session_cwd

Module session_cwd 

Source
Expand description

Stored-session working-directory recovery.

Port of the upstream packages/coding-agent/src/core/session-cwd.ts. A session file records the cwd it was created in; when that directory has since been deleted, restoring the session must either fall back to the current cwd or fail with a clear, actionable message instead of silently operating in a non-existent directory.

Structs§

MissingSessionCwdError
Error raised when a session’s cwd cannot be resolved and no override was supplied.
SessionCwdIssue
A session whose recorded working directory no longer exists on disk.

Functions§

assert_session_cwd_exists
Fail unless the session cwd exists (native assertSessionCwdExists).
format_missing_session_cwd_error
One-line error message (native formatMissingSessionCwdError).
format_missing_session_cwd_prompt
Short prompt shown by the startup selector (native formatMissingSessionCwdPrompt).
get_missing_session_cwd_issue
Detect a missing session cwd. Returns None when there is no session file, the stored cwd is empty, or the stored cwd still exists.