sinelaw/fresh · error

project path does not exist

Error message

project path does not exist: ${requestedPath}

What it means

The orchestrator's local create path verifies that a caller-supplied `path` exists on the local filesystem via editor.fileExists(editor.localPath(requestedPath)) before building the spec. If the path is missing, it throws. The comment explains why: the interactive dialog autocompletes against the filesystem so a human sees a bad path immediately, but a hand-written caller would otherwise 'succeed' into a workspace rooted at a nonexistent directory.

Solutions

  1. Check the path exists before calling: `fs.existsSync(requestedPath)` or create it first with mkdir -p.
  2. Correct typos in the configured project path in your script or config.
  3. If the path was copied from a remote-create call, strip any host prefix and use a local absolute path.
  4. Omit `path` entirely to fall back to localProjectDefault() instead of passing a bad path.

Example fix

// before
await orchestrator.createLocal({ path: "/home/me/projeckt" });
// after
const p = "/home/me/project";
if (!require("fs").existsSync(p)) throw new Error(`fix path: ${p}`);
await orchestrator.createLocal({ path: p });
Defensive patterns

Strategy: validation

Validate before calling

import { existsSync } from "fs";
const p = options.path;
if (p && !existsSync(p)) throw new Error(`project path does not exist: ${p}`);
// or omit path to use localProjectDefault()

Type guard

function isExistingDir(p) { return typeof p === "string" && p.length > 0 && existsSync(p); }

Try / catch

try {
  const ws = await orchestrator.createLocal({ path: requestedPath });
} catch (e) {
  if (/project path does not exist/.test(String(e))) {
    const corrected = await promptForPath();
    ws = await orchestrator.createLocal({ path: corrected });
  } else { throw e; }
}

Prevention

When it happens

Trigger: Calling the local create/run API with `options.path` set to a directory that does not exist on disk (typo, unmounted volume, path on a different machine, or relative path resolved against the wrong base).

Common situations: Automation scripts hardcoding paths that exist only on the author's machine; CI runners where the repo hasn't been checked out yet; typos or trailing hostname prefixes left in from a remote-create style path; case-sensitivity mismatches on Linux.

Related errors


AI-assisted analysis of sinelaw/fresh@67894ca546 (2026-09-13). Data as JSON: /api/errors/ea39552d7523ffe1. Report an issue: GitHub.

Appendix: source

Thrown at crates/fresh-editor/plugins/orchestrator.ts:10430

      cmd,
      remotePath: trimmed(options.path),
      identity: trimmed(options.identity),
      extraArgs,
    });
    // The dialog keeps itself open on a bad host and shows the message; a
    // caller gets the same message as a thrown error.
    if (!built.ok) throw new Error(built.error);
    return built.spec;
  }

  const requestedPath = trimmed(options.path);
  const projectPath = requestedPath || localProjectDefault();
  // A path the caller passed has to exist. The dialog's field completes against
  // the filesystem, so a human sees a wrong path immediately; a caller passing
  // `path` by hand does not, and the create would otherwise "succeed" into a
  // workspace rooted at a directory that isn't there.
  if (requestedPath && !editor.fileExists(editor.localPath(requestedPath))) {
    throw new Error(`project path does not exist: ${requestedPath}`);
  }
  return buildLocalSpec({
    ...agentOptions,
    projectPath,
    // "" ⇒ `runLocalCreate` allocates the next `<project>-N` name, the same
    // default the dialog's placeholder shows.
    name,
    cmd,
    branch: trimmed(options.branch),
    newBranch: trimmed(options.newBranch),
    // Worktree by default (the dialog's default too); `runLocalCreate` demotes
    // it to false on its own when the path isn't a git tree.
    createWorktree: options.worktree ?? true,
  });
}

async function newWorkspace(
  options: NewWorkspaceOptions = {},

View on GitHub (pinned to 67894ca546)