Daemon and Process Troubleshooting
Audience: Users — Pipeline operators experiencing issues with the daemon, process cleanup, or batch runs.
Daemon Mode
Daemon not reachable at unix:///.../.hpilot/run/daemon.sock
The command selected the canonical current workspace and no Harness Pilot WebSocket daemon answered at its Unix socket. Start it from that workspace with hpilot serve. A client in a sibling or subdirectory intentionally does not discover a parent daemon; change to the daemon workspace or pass its absolute --socket path.
For explicit TCP migration, configure server.transport: tcp or supply a TCP flag to every participating command:
hpilot serve --host 127.0.0.1 --port 9000
hpilot status --host 127.0.0.1 --port 9000There is no Unix-to-TCP fallback or dual listener. For path is ... encoded bytes, create a shorter private 0700 directory and pass --socket, or use explicit TCP. For a missing custom parent, create exactly that directory as the invoking user with mode 0700. For unsafe permissions, foreign ownership, a symlink, a regular file, an unrecorded socket, or an active service, correct the named conflict rather than deleting runtime ownership records. After an owned crash, restart normally: Harness Pilot reclaims only a matching recorded inactive socket while holding both lifecycle locks.
Accepted task stream reports unknown status
After run_accepted, Harness Pilot makes three bounded cursor-based resume attempts. If all fail, submit reports that the named task status is unknown and exits non-zero without a traceback. Do not resubmit immediately: the original task may still be running. Restore daemon connectivity and use hpilot status --task-id <id> or hpilot attach <id>; inspect .hpilot/logs/services/daemon.jsonl for connection context. A batch leaves the current and later plans pending in this state.
nested_task_rejected when submitting
You submitted a new task from a directory that already has a running daemon task. Submit from a different directory, or cancel the existing task first.
Process Cleanup
Agent subprocess hangs
- OpenCode V2 serve starts an owned authenticated loopback server per stage. Cancellation interrupts the native session, skips keep-alive/usage waits, and stops only the owned server plus verified descendants (including detached MCP children) with bounded escalation. There is no
/instance/disposeAPI. Use task cancellation or the owning terminal handle, not process-name scans or raw kills; see the OpenCode guide. - Codex runs synchronously through the SDK. Cancellation is a no-op until the active turn returns; SDK resources then close normally.
- In-process adapters (Claude and Cursor) use cooperative SDK cancellation.
- Antigravity requests
session/cancelon the active ACP turn, then applies bounded cleanup to its owned process tree. - If any agent subprocess persists beyond 12 seconds after stage completion, the pipeline-level process sweep should still catch it.
Agent-spawned processes remain after pipeline finishes
Harness Pilot terminates descendant processes at two points: after each stage (process group kill plus individual PID fallback) and after the full pipeline (process-tree sweep). If a process survives both:
- Check disposable
.hpilot/logs/hpilot.log.jsonlfor entries with"status": "Cleanup"— these show which PIDs were targeted and whether SIGTERM/SIGKILL was sent. - A process that called
setpgidorsetsidto leave the agent's process group and was then reparented to init (because its parent exited) may not be discoverable by the pipeline-level sweep. This is a known limitation. - To check for remaining processes:
ps aux | grep -E 'vite|npm|node'or usepsutilto walk the process tree from the Harness Pilot process.
Cleanup logs show "already exited" messages
This is normal and expected. When a process exits between discovery and termination, Harness Pilot logs a warning and continues. These messages confirm best-effort cleanup is working correctly.
Batch Submit (--path)
Batch stops after one file fails
This is expected behavior. --path stops on the first non-zero exit code so you can inspect and fix the problem before continuing.
- The failing plan stays at the top level.
- Plans already queued or still being written remain untouched.
- Files already moved to
completed/are skipped on re-run. - A recovery invocation builds a new queue from the remaining ready plans.
# Fix the issue, then re-run the same command
hpilot submit --path prompts/Later plans in a batch ignore --start-from
This is intended. --start-from and --resume apply only to the first plan submitted in the current invocation.
- A recovery run can continue the first remaining plan at the selected stage.
- Every later plan runs from the first configured stage with a fresh session.
--end-afterand--end-beforestill apply to every plan in the batch until cleared.
Operator end stops the whole batch
While submit --path is running, hpilot end --after <stage> or hpilot end --before <stage> is an operator halt, not a per-plan boundary. The current plan remains in the source directory, later plans are not submitted, and the batch exits successfully with status 0. Re-run the batch when you want to process the retained plan.
If the active task has already passed the requested stage, it cannot reach that stage boundary. Harness Pilot lets the task finish, moves its completed plan to completed/, and carries the boundary into the next submitted task. Thus hpilot end --before Plan during Commit finishes the current Commit task, creates task 2, and halts task 2 before its Plan stage executes; the second plan stays pending in the source directory.
Submit-time submit --end-after and submit --end-before boundaries also stop the batch when reached, leaving the current and later plans pending. Run hpilot end --clear before the runner commits the boundary decision to let the current task complete and move to completed/, then drop the boundary for later plans in that batch process. The clear is best-effort near a stage boundary and does not change flags for a new submit --path invocation.
--path directory has no .md files
The initial discovery must find at least one ready .md file at the top level. Non-.md files are ignored, and subdirectories such as completed/ are not searched recursively.
ls prompts/*.md # confirm .md files exist at the top levelIf a Markdown plan exists but the command still reports no ready files, it may have changed during the approximately 0.5-second readiness interval. Finish writing the file, wait briefly, and invoke the command again. For automation, write a temporary file and atomically rename it to its final .md name.
A changing plan was deferred
A deferral message means the plan's size or modification time changed, or the file disappeared, between the two readiness observations. Harness Pilot does not read or queue that candidate. It can join a later scan after it becomes stable.
When the active queue is exhausted, only one final bounded scan is required. If the file is still unstable then, the command exits normally rather than watching forever. Run submit --path again after the file is complete.
A plan added after completion was not submitted
The command stops after its queue is empty and a final readiness scan finds no new ready plan. A file published after No pending plans remain or after process exit belongs to the next invocation. Dynamic discovery is limited to an active batch; it is not a persistent directory watcher.
Files are processed in the wrong order
The initial ready group is sorted lexicographically. Each later discovery group is also sorted, then appended behind every plan already waiting. A later plan never jumps ahead of the existing queue. Use zero-padded names for predictable ordering:
01-first-task.md # processed first
02-second-task.md
10-tenth-task.md # not between 01 and 02Concurrent batch runs against the same directory
No locking is applied to the prompt directory. Running two --path submissions against the same directory concurrently may cause race conditions (e.g., both trying to move the same file to completed/). Use separate directories or run batches sequentially.