Return Desk missing-directory decisions
A saved conversation can outlive the project directory recorded in its header.
That is not merely another search failure. It raises a new question: where should this conversation be rooted now?
Milestone: Choose relocation or fallback consciously
Need. Maya finds the right journal, but its recorded project directory is gone.
Obstacle. Different entry paths do not ask the same question or perform the same relocation.
This is a decision exercise. Do not delete a directory to manufacture it.
Exact action: identify which entry path you are using, then apply the matching row below. For an ID-based relocation prompt, choose Yes only when the launch directory is the intended replacement project.
| Entry path and condition | Current behavior | What to inspect afterward |
|---|---|---|
Startup --resume <id>; recorded cwd still exists | Open the matched journal. Startup adopts the resumed project scope and reloads cwd-scoped settings/caches. | Identity, journal file, active directories, applicable project settings. |
Startup --resume <id>; recorded cwd is gone; Yes or default answer | Re-root that same session into the launch directory. The journal and its artifact namespace are relocated, not duplicated as a fork. | Same persistent ID; new journal location; updated header cwd. |
| Same ID lookup; No | Cancel startup rather than fall through to a new conversation. | No successful resume; original journal remains available. |
| Same ID lookup; consent unavailable without a TTY | Fail with an instruction to run interactively. | No assumed relocation. |
Startup --resume <path.jsonl>; recorded cwd is gone | Direct opening bypasses the ID relocation prompt. Active cwd falls back to the launch project without relocating the journal. | Same journal location; active cwd may differ from the retained recorded header cwd. |
| Runtime session-file switch; recorded cwd is gone | Keep the current active project instead of changing into a nonexistent directory. | Target identity, unchanged active cwd, original journal location. |
| Startup picker selects a session with missing cwd | Its direct-open path does not provide the ID-lookup relocation consent flow. | Launch-cwd fallback and journal location, rather than assumed relocation. |
--continue; breadcrumb’s source project is gone and destination lacks its own history | Can automatically re-root the same session into the destination. | Same identity, relocated journal, destination cwd. |
--continue; destination has its own applicable history | Prefer destination history rather than automatically adopting the vanished project’s session. | Which identity actually won. |
For the ID prompt, an empty answer means acceptance in the supplied source. Declining produces the source-backed startup message Resume cancelled: session was not moved.
What re-rooting does not repair
Re-rooting concerns the journal/artifact namespace and the session’s cwd. It does not:
- Restore a missing repository.
- Move or reconstruct the old workspace files.
- Make old tool results accurate for the new directory.
- Prove that the destination’s instructions are compatible with the old task.
- Rewrite every historical path inside conversation content.
A successful cross-project resume can also change which project settings and instructions apply. That is why cwd belongs in the ledger rather than in a footnote.
Recorded checks. Injected acceptance moved the same identity; decline returned no manager; unavailable consent raised the interactive-use instruction. Direct-path opening retained the journal location and used launch-cwd fallback. Controller checks also confirmed missing-cwd fallback and settings-save failure before switching.
Those answers were injected into the existing prompt seam, not typed into a physical readline prompt.
Failure and recovery. If relocation or cwd re-scoping fails, stop before further work. Inspect identity, current journal location, and active directories. The supplied code includes relocation and rollback handling, but the evidence does not establish an all-filesystem, all-failure atomicity guarantee.
Self-check. Maya opened a direct JSONL path, and the active cwd is now the launch directory. Has the journal necessarily moved?
Answer: No. Direct-path fallback and ID-based re-rooting are different operations.
Source anchors: packages/coding-agent/src/main.ts — promptMoveSession, moveMissingCwdSessionIfNeeded, switchToResumedProject; packages/coding-agent/src/session/session-manager.ts — open, setSessionFile, moveTo, continueRecent; packages/coding-agent/src/config/settings.ts — reloadForCwd.
Sessions, resets, and reviewable history · Source chapter: continuity/return-desk-missing-directory-decisions. Original evidence remains scoped to its recorded snapshot.