Before submitting
Problem
On macOS, the installed gentle-pi 3.4.0 subagent runner repeatedly fails to start gentle-ai-explore and gentle-ai-worker. The parent reports pi exited with code unknown before agent_settled. Stored tasks show zero turns, tools, and tokens and no child session path. Ordinary Pi RPC startup succeeds; the failure is specific to the subagent launch shape.
The runner's childArguments() passes the complete agent instructions as one literal --append-system-prompt CLI argument (lib/agents-runner.ts). In a controlled subprocess reproduction, passing the explorer's ~4.3 KB instructions inline caused the child to exit with code: null, signal: SIGKILL, no stdout/stderr, and no get_state response. Passing the same text through a temporary prompt file path to --append-system-prompt returned get_state and exited 0. A 1000-character inline prefix succeeded; larger ~1250-2000-character inline arguments triggered the early signal in this environment. The source of SIGKILL is not established, so the report does not attribute it to Pi, macOS, or a particular security policy.
The runner listens for the child exit event using only code and formats null as unknown, discarding Node's separate signal argument. This hides a decisive diagnostic.
Steps to reproduce
- On macOS with Pi 0.87.1 and gentle-pi 3.4.0, request a minimal
subagent_run using the installed gentle-ai-explore agent; no tools or file edits are needed in the delegated prompt.
- Observe
pi exited with code unknown before agent_settled and inspect the task record: no child session path, zero turns and tools.
- As a control, spawn Pi in RPC mode with
--append-system-prompt set to a synthetic string of about 2000 characters and send {"id":"probe","type":"get_state"}. Capture Node's exit(code, signal) pair and stdout/stderr.
- Repeat with the identical string written to an owner-only temporary file and pass its path as
--append-system-prompt. Remove the temporary file and session directory after each run.
- In the observed setup, the inline case exited within ~10-20 ms with
SIGKILL and no RPC output; the file-path case returned get_state and exited 0. Short inline arguments also worked.
Expected and actual behavior
Expected: long agent instructions should reach the child reliably, or launch failures should identify the terminating signal; no unrelated child task should be lost before the first run event.
Actual: package-owned explorer and worker launches fail before agent_settled with an unknown exit code. The direct controlled comparison isolates long inline CLI arguments as the reproducible trigger here, while the current error discards the signal.
Potential fix for investigation: use a bounded/path-based transport for agent instructions rather than putting arbitrarily long instructions in argv; preserve signal in runner exit diagnostics. Add a regression covering a large agent definition and cleanup of temporary transport artifacts.
gentle-pi version
3.4.0
Pi version
0.87.1
Operating system
macOS
Relevant logs or error output (optional)
Subagent gentle-ai-explore failed: pi exited with code unknown before agent_settled
Controlled child exit (inline instructions): {"code":null,"signal":"SIGKILL"}; no stdout/stderr
Controlled child exit (same instructions via temporary file): {"code":0,"signal":null}; get_state response present
Before submitting
Problem
On macOS, the installed gentle-pi 3.4.0 subagent runner repeatedly fails to start
gentle-ai-exploreandgentle-ai-worker. The parent reportspi exited with code unknown before agent_settled. Stored tasks show zero turns, tools, and tokens and no child session path. Ordinary Pi RPC startup succeeds; the failure is specific to the subagent launch shape.The runner's
childArguments()passes the complete agent instructions as one literal--append-system-promptCLI argument (lib/agents-runner.ts). In a controlled subprocess reproduction, passing the explorer's ~4.3 KB instructions inline caused the child to exit withcode: null,signal: SIGKILL, no stdout/stderr, and noget_stateresponse. Passing the same text through a temporary prompt file path to--append-system-promptreturnedget_stateand exited 0. A 1000-character inline prefix succeeded; larger ~1250-2000-character inline arguments triggered the early signal in this environment. The source ofSIGKILLis not established, so the report does not attribute it to Pi, macOS, or a particular security policy.The runner listens for the child
exitevent using onlycodeand formatsnullasunknown, discarding Node's separatesignalargument. This hides a decisive diagnostic.Steps to reproduce
subagent_runusing the installedgentle-ai-exploreagent; no tools or file edits are needed in the delegated prompt.pi exited with code unknown before agent_settledand inspect the task record: no child session path, zero turns and tools.--append-system-promptset to a synthetic string of about 2000 characters and send{"id":"probe","type":"get_state"}. Capture Node'sexit(code, signal)pair and stdout/stderr.--append-system-prompt. Remove the temporary file and session directory after each run.SIGKILLand no RPC output; the file-path case returnedget_stateand exited 0. Short inline arguments also worked.Expected and actual behavior
Expected: long agent instructions should reach the child reliably, or launch failures should identify the terminating signal; no unrelated child task should be lost before the first run event.
Actual: package-owned explorer and worker launches fail before
agent_settledwith anunknownexit code. The direct controlled comparison isolates long inline CLI arguments as the reproducible trigger here, while the current error discards the signal.Potential fix for investigation: use a bounded/path-based transport for agent instructions rather than putting arbitrarily long instructions in argv; preserve
signalin runner exit diagnostics. Add a regression covering a large agent definition and cleanup of temporary transport artifacts.gentle-pi version
3.4.0
Pi version
0.87.1
Operating system
macOS
Relevant logs or error output (optional)