@gonzih/cc-discord 0.2.34 → 0.2.35
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.
|
@@ -298,11 +298,15 @@ function spawnPersistentSession(ns, token, wire, onExit) {
|
|
|
298
298
|
const claudeBin = resolveClaude();
|
|
299
299
|
const env = buildEnv(token);
|
|
300
300
|
console.log(`[meta-agent-manager] spawning persistent session (ns=${ns})`);
|
|
301
|
+
// DO NOT ADD -p OR --input-format stream-json HERE.
|
|
302
|
+
// With -p + --input-format stream-json, Claude buffers all stdin until EOF before responding.
|
|
303
|
+
// Since the stdin pipe is never closed (it stays open for subsequent messages), Claude
|
|
304
|
+
// waits forever and never produces output. Interactive mode (no -p) reads one line at a
|
|
305
|
+
// time and responds immediately. Verified by direct test: `echo msg | claude --continue
|
|
306
|
+
// --output-format stream-json ...` responds correctly; the -p variant does not.
|
|
301
307
|
const proc = spawn(claudeBin, [
|
|
302
308
|
"--continue",
|
|
303
|
-
"-p",
|
|
304
309
|
"--output-format", "stream-json",
|
|
305
|
-
"--input-format", "stream-json",
|
|
306
310
|
"--verbose",
|
|
307
311
|
"--dangerously-skip-permissions",
|
|
308
312
|
], { cwd: wsPath, env, stdio: ["pipe", "pipe", "pipe"] });
|
|
@@ -348,9 +352,8 @@ export function createMetaAgentManager() {
|
|
|
348
352
|
if (!session)
|
|
349
353
|
return;
|
|
350
354
|
try {
|
|
351
|
-
//
|
|
352
|
-
|
|
353
|
-
session.proc.stdin.write(`${payload}\n`);
|
|
355
|
+
// Interactive mode: plain text line, Claude reads it as user input
|
|
356
|
+
session.proc.stdin.write(`${line}\n`);
|
|
354
357
|
}
|
|
355
358
|
catch (err) {
|
|
356
359
|
console.warn(`[meta-agent-manager] stdin write failed (ns=${ns}):`, err.message);
|