coleam00/Archon · error
Workflow run '${resolvedId}' has no working path recorded. C
Error message
Workflow run '${resolvedId}' has no working path recorded.
Cannot determine where to resume. What it means
The `archon workflow approve --json --detach` path resolves the run, asserts it is approvable, then refuses to proceed if the run has no recorded working_path. The working path is where the child process executes; without it the CLI cannot know where to resume the run after approval, so it fails synchronously instead of acking and letting the child die unseen.
Source
Thrown at packages/cli/src/commands/workflow.ts:4513
// --detach: hand the approve AND its inline auto-resume to a detached child
// (same argv minus --detach/--json). Handled BEFORE any state change — the
// parent only validates read-only, so the approval is recorded exactly once,
// in the child. Composes with --json (structured ack; nothing executes here).
if (detach) {
const resolvedId = await resolveRunIdArg(runId, cwd);
await runDetachedControlCommand(resolvedId, 'approve', json, cwd, async () => {
const run = await workflowDb.getWorkflowRun(resolvedId);
if (!run) {
throw new Error(`Workflow run not found: ${resolvedId}`);
}
// The SAME gate approveWorkflow enforces — not a copy of one branch of it.
// A partial copy acks { ok: true } and lets the child die unseen.
assertApprovable(run);
// The child always auto-resumes after approving, and the inline path below
// refuses a run with no recorded working path. Same check here (message
// copied verbatim) so the refusal is synchronous instead of buried in a log.
if (!run.working_path) {
throw new Error(
`Workflow run '${resolvedId}' has no working path recorded.\n` +
'Cannot determine where to resume.'
);
}
return run;
});
return;
}
// JSON mode records the approval and returns a structured ack WITHOUT the
// inline auto-resume (resuming executes the workflow and streams output to
// stdout, which would corrupt the JSON contract). The run becomes resumable
// — drive it to completion with a backgrounded `resume`/`run --resume`.
if (json) {
try {
const resolvedId = await resolveRunIdArg(runId, cwd);
const result = await approveWorkflow(resolvedId, comment);
await writeJsonLine({View on GitHub (pinned to 0773b97458)
Solutions
- Verify the run actually has a workspace: check the run record (e.g. via `workflow list`/DB query) for a non-empty working_path.
- Re-create or re-launch the run so the engine records a fresh working path instead of resuming the orphaned record.
- If the workspace directory still exists on disk, backfill working_path in the database to that directory, then retry the approve.
- If the run is dead/abandoned, reject or cancel it rather than approving.
Example fix
// before
await approveWorkflow(resolvedId, comment); // may hit a run with working_path = null
// after
const run = await workflowDb.getWorkflowRun(resolvedId);
if (!run) throw new Error(`Workflow run not found: ${resolvedId}`);
if (!run.working_path) throw new Error(`Workflow run '${resolvedId}' has no working path recorded.`);
await approveWorkflow(resolvedId, comment); Defensive patterns
Strategy: validation
Validate before calling
import { workflowDb } from '../db.js';
const run = await workflowDb.getWorkflowRun(resolvedId);
if (!run) throw new Error(`Workflow run not found: ${resolvedId}`);
if (!run.working_path) throw new Error(`Run ${resolvedId} has no working path; fix or recreate before approving.`); Type guard
function hasWorkingPath(run: { working_path?: string | null }): run is { working_path: string } {
return typeof run.working_path === 'string' && run.working_path.length > 0;
} Try / catch
try {
await approveDetached(resolvedId, comment);
} catch (e) {
if ((e as Error).message.includes('no working path recorded')) {
// inspect/backfill the run record before retrying
}
throw e;
} Prevention
- Check the run's working_path before scripting approve/reject/respond calls
- Avoid inserting or importing run rows directly into the database
- Keep the engine upgraded so working-path recording bugs are patched
- Treat runs without a workspace as terminal and recreate them instead of resuming
When it happens
Trigger: Calling `workflow approve <id> --json --detach` (or any detach path that runs this pre-check) on a run whose `working_path` column is null/empty — e.g. a run created before working-path tracking, a manually seeded DB row, or a run whose workspace directory record was lost.
Common situations: Operators upgrading an older database whose rows predate working_path recording; runs created through direct DB manipulation or import tooling; corrupted/partial run records after a crash during run creation.
Related errors
- Cannot execute run '${detachedPreCreatedRun.id}': it belongs
- Dry-run failed; missing stubs: ${blockingMissingStubs.join('
- Cannot resume: the prior run for '${workflowName}' has no co
- Failed to get workflow run: ${err.message}
- --open and --status are mutually exclusive: the inbox is fai
AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01).
Data as JSON: /api/errors/ee35a3a4eaaeaf9c.
Report an issue: GitHub.