fix: use temp file for AI check prompt to avoid E2BIG spawn error

The AI idle checker was passing the prompt (including up to 16KB of terminal
buffer) as a command-line argument to bash -c, which exceeded the Linux
argument size limit causing "spawn E2BIG" errors.

Now writes the prompt to a temp file and pipes it to claude via stdin,
avoiding the argument size limit entirely. Temp file is cleaned up both
in the normal case (by the shell command) and on cancellation/timeout.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-25 06:54:56 +01:00
co-authored by Claude Opus 4.5
parent 706392d264
commit 0aca55b099
3 changed files with 25 additions and 9 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
Claudeman is a Claude Code session manager with a web interface and autonomous Ralph Loop. It spawns Claude CLI processes via PTY, streams output in real-time via SSE, and supports scheduled/timed runs.
**Version**: 0.1341
**Version**: 0.1342
**Tech Stack**: TypeScript (ES2022/NodeNext, strict mode), Node.js, Fastify, Server-Sent Events, node-pty