tinyhumansai/openhuman · error · Error

--isolated-workspace requires --spawn-core

Error message

--isolated-workspace requires --spawn-core

What it means

CLI usage validation in main() of harness-cache-audit. --isolated-workspace creates a throwaway mkdtemp workspace and writes audit agent definitions into it; only a core spawned by this run (--spawn-core) will serve that fresh directory. An already-running attached core is bound to a different workspace, so the flag combination is rejected up front instead of auditing the wrong data silently.

Source

Thrown at scripts/debug/harness-cache-audit.mjs:562

      return;
    } catch {
      await new Promise((resolve) => setTimeout(resolve, 750));
    }
  }
  throw new Error(
    `timed out waiting for spawned core at ${coreUrl}\n${stderrFn()}`,
  );
}

async function main() {
  const opts = parseArgs(process.argv.slice(2));
  if (!opts.workspace) opts.workspace = await defaultWorkspace();

  let tempWorkspace = "";
  let spawned;
  if (opts.isolatedWorkspace) {
    if (!opts.spawnCore)
      throw new Error("--isolated-workspace requires --spawn-core");
    tempWorkspace = await mkdtemp(
      path.join(tmpdir(), "openhuman-harness-cache-audit-"),
    );
    opts.workspace = path.join(tempWorkspace, "workspace");
    await mkdir(opts.workspace, { recursive: true });
    await writeAuditDefinitions(opts.workspace);
  }

  if (opts.spawnCore) {
    if (!opts.coreUrlExplicit) {
      const port = await pickFreePort();
      opts.coreUrl = `http://127.0.0.1:${port}/rpc`;
    }
    spawned = await startCore(opts);
    opts.token = spawned.token;
  } else {
    opts.token = await readToken(opts);
  }

View on GitHub (pinned to a221052e0d)

Solutions

  1. Add `--spawn-core` so the audit spawns a core against the temp workspace
  2. Or drop `--isolated-workspace` entirely to audit the workspace of the already-running core you are attaching to

Example fix

# before
node scripts/debug/harness-cache-audit.mjs --isolated-workspace

# after
node scripts/debug/harness-cache-audit.mjs --isolated-workspace --spawn-core --keep-workspace
Defensive patterns

Strategy: validation

Validate before calling

const needSpawn = argv.includes("--isolated-workspace");
if (needSpawn && !argv.includes("--spawn-core")) {
  console.error("--isolated-workspace starts a temp workspace; add --spawn-core");
  process.exit(2);
}

Prevention

When it happens

Trigger: Invoking `node scripts/debug/harness-cache-audit.mjs --isolated-workspace` without also passing `--spawn-core` — e.g. copied from a longer command line and trimmed, or assuming the script attaches to the desktop app's core while still isolating the workspace.

Common situations: Trying to get 'a clean workspace' against an attached core; shell history editing that drops a flag; wrapping the script in tooling that adds --isolated-workspace but not --spawn-core.

Related errors


AI-assisted analysis of tinyhumansai/openhuman@a221052e0d (2026-08-16). Data as JSON: /api/errors/e4f1c075c0bdc0ab. Report an issue: GitHub.