parallelclaw 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  Notable changes to parallelclaw (formerly memex-mvp). Older history lives in the git log.
4
4
 
5
+ ## 1.2.1 — patch: make the Mac executor's `claude -p` actually complete
6
+
7
+ The Phase 2b headless executor invoked `claude -p` but every run hung until the
8
+ 4-minute timeout. Two fixes, live-verified end-to-end (delegate → Mac executor →
9
+ real `claude -p` result returned in ~7s):
10
+ - **Close the child's stdin.** `claude -p` reads stdin to EOF even with the prompt
11
+ passed as an arg; `execFile` left it open, so the process waited forever. Ending
12
+ stdin lets the run finish and exit.
13
+ - **Strip Claude-session env markers** (`CLAUDECODE`, `CLAUDE_CODE_ENTRYPOINT`,
14
+ `CLAUDE_CODE_SSE_PORT`) before spawning, so the headless child is a clean,
15
+ separate session instead of being rejected as "nested inside another Claude
16
+ Code session" (matters when `task-run-once` is invoked from a Claude shell;
17
+ launchd already runs clean).
18
+
19
+ Upgrade required for the installed Mac executor: `npm i -g parallelclaw@1.2.1`
20
+ (the launchd job picks up the fixed code on its next tick — no reinstall needed).
21
+
5
22
  ## 1.2.0 — delegate by talking + the laptop as executor
6
23
 
7
24
  Coordination, now from natural language. Two MCP tools so any MCP client (Claude
package/lib/executor.js CHANGED
@@ -64,8 +64,16 @@ function buildExecPrompt(env) {
64
64
  function claudeRunner(prompt, { timeoutMs = DEFAULT_TIMEOUT_MS, cwd } = {}) {
65
65
  return new Promise((res, rej) => {
66
66
  const bin = process.env.PARALLELCLAW_CLAUDE_BIN || 'claude';
67
- execFile(bin, ['-p', prompt],
68
- { timeout: timeoutMs, maxBuffer: 8 * 1024 * 1024, encoding: 'utf8', cwd: cwd || DATA },
67
+ // `claude -p` refuses to launch "inside another Claude Code session". The
68
+ // headless executor IS a separate, legitimate session strip the inherited
69
+ // session markers so the child starts clean. launchd already runs without
70
+ // them; this also lets `task-run-once` work when invoked from a Claude shell.
71
+ const env = { ...process.env };
72
+ delete env.CLAUDECODE;
73
+ delete env.CLAUDE_CODE_ENTRYPOINT;
74
+ delete env.CLAUDE_CODE_SSE_PORT;
75
+ const child = execFile(bin, ['-p', prompt],
76
+ { timeout: timeoutMs, maxBuffer: 8 * 1024 * 1024, encoding: 'utf8', cwd: cwd || DATA, env },
69
77
  (err, stdout, stderr) => {
70
78
  if (err) {
71
79
  if (err.killed) return rej(new Error(`claude -p timed out after ${timeoutMs}ms`));
@@ -73,6 +81,10 @@ function claudeRunner(prompt, { timeoutMs = DEFAULT_TIMEOUT_MS, cwd } = {}) {
73
81
  }
74
82
  res(String(stdout || '').trim());
75
83
  });
84
+ // `claude -p` reads stdin until EOF even when the prompt is passed as an arg.
85
+ // execFile leaves the child's stdin open → it hangs until the timeout. Close
86
+ // it so the run completes and exits (verified: 240s timeout → ~7s with EOF).
87
+ try { child.stdin && child.stdin.end(); } catch (_) {}
76
88
  });
77
89
  }
78
90
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parallelclaw",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Local-first personal AI ops layer. Shared verbatim memory across your agents (Claude Code, Cursor, OpenClaw, Hermes, Obsidian, Telegram) in one SQLite + FTS5 corpus — plus a coordination layer where any of your agents can delegate tasks to any other. Searchable from any MCP-compatible client.",
5
5
  "type": "module",
6
6
  "main": "server.js",