[Bug] Native Claude recreation depends on a removed process cwd
Author: LeemoonsooCreated Sep 16, 2026Updated Oct 1, 2026
LabelsBugcomp:runnerP2-mediumtriagedvalidated:reproducedvalidatingcomp:harness-t1
Problem
Recreating a native Claude terminal can fail with FileNotFoundError when the runner remains alive but its process working directory was removed. An explicit, valid session workspace does not reliably avoid the failure: the environment fallback eagerly evaluates Path.cwd(), and project-config loading separately reads the implicit cwd.
Expected behavior
- Resolve the explicit session workspace, then runner workspace, before consulting process cwd.
- Load project configuration from the selected workspace without changing process cwd.
- If the selected workspace is gone, report an actionable
workspace_missingerror; never silently start in home or another directory. - Preserve existing resume transcripts and project-config merge semantics.
Validation
Synthetic unit tests can make cwd lookup raise while using a valid temporary workspace, exercise both initialization-envelope and legacy terminal setup, and reject a missing explicit workspace before launch. No live runner or real worktree needs to be removed.
Related to #3971 and #5030.
Source: omnigent-ai/omnigent