Pipeline Execution Troubleshooting
Audience: Users — Pipeline operators encountering errors during pipeline runs.
Workspace and Locks
A task is already running in this directory
Another pipeline is active in the same working directory.
Option A — Attach to the running task:
hpilot attachOption B — Cancel it:
hpilot cancelOption C — If you are sure nothing is running, remove stale locks:
rm .hpilot/instance.lockIf the daemon is running, also check:
hpilot statusLegacy hook files remain in the workspace
Current Harness Pilot runs do not create .hpilot/hooks/, .hpilot/hook-events.sock, hook_config.json, or settings snapshots. An older run may have left these files behind. Confirm that no older Harness Pilot process is using them, then remove the stale files manually. The current evaluation log is .hpilot/logs/evaluation-events.jsonl.
Agent and Adapter Execution
Agent exits immediately with no output
- Confirm OpenCode is installed with
opencode --version; for Codex, verify bothpython -c "import openai_codex"andcodex --version. - Claude requires its included Python SDK and a standalone
claudeexecutable onPATH; Cursor uses its bundled Python SDK. Antigravity requiresagyonPATHwith ACP v1 and session resume or load and a completed interactive login. Runhpilot doctorto verify the selected adapter. - Check preflight output at the top of the run for missing prerequisites.
- For harness-specific prerequisites, authentication, or session timeouts, see the supported harness guides.
tool call: lines show only a title
Live stderr builds tool call: lines from each agent's structured events.
- A label-only line is normal when the event has no arguments.
- For protocol-based agents, summaries appear only when the tool payload includes usable argument fields.
- For serve-based agents like OpenCode, summaries appear from SSE event payloads. (OpenCode deduplicates bare tool-call start events and suppresses lifecycle/metadata events from stderr, though they still appear in the JSONL stage log).
- For Antigravity, summaries come from ACP tool-call updates.
- If summaries disappeared after upgrading an agent, compare the live line with the raw entry in
.hpilot/logs/stages/. Antigravity records ACP events; OpenCode records HTTP/SSE events. Maintainers should update the owning translation layer, not shared rendering.
Write Protection (read_only_paths)
Agent is blocked from writing to a file
If the agent reports "Path X is protected by the pipeline (read_only_paths)", the file matches a pattern in the current stage's read_only_paths in hpilot.yaml.
- Check your stage's
read_only_pathspatterns — they use path-segment glob matching resolved relative to the workspace root.*matches within one path segment, and**matches zero or more path segments. For example,src/**matches all files undersrc/, and**/*.pymatches Python files at any depth. - If the block is unexpected, verify the pattern isn't too broad. For example,
**/*.pyblocks all Python files project-wide. Use a narrower pattern such assrc/**/*.pywhen only one tree should be protected. - Bash commands that write to protected paths (
>,>>,sed -i,tee) are detected and reported without restoration by the Git-backed guard, or blocked by native adapter permission rules. Restructure the command to avoid writing to protected paths.
read_only_paths is not blocking writes
- Confirm
read_only_pathsis set on the relevant stage inhpilot.yaml(it is a per-stage field, not a top-level field or a~/.hpilot/config.yamlfield). - Empty or absent
read_only_pathsfor a stage means no write protection is installed for that stage. Adapter-level read-only enforcement is only active when the list is non-empty. - Post-run verifier evaluation is independent of
read_only_pathsand does not gate tool calls. - Enforcement scope:
- Claude uses Git-backed change detection that reports protected Git-visible changes without restoring them; the stage fails if a protected path was modified.
- Cursor uses Git-backed detect-only enforcement after each SDK turn. A protected file can be changed briefly before detection, so use a read-only mount when pre-write prevention is required.
- OpenCode enforces read-only paths with ordered native and session permission rules plus programmatic MCP write admission via a process-local configuration overlay.
- Codex SDK stages detect protected Git-visible changes after each turn, leave them in place, and fail the attempt.
- Antigravity uses Git-backed change detection after its unrestricted, process-local CLI permission override.
- External processes or direct filesystem writes outside the agent session are not blocked.
- Git-ignored files are intentionally outside the non-OpenCode guard. If a warning names an ignored or uncovered pattern, protect a Git-visible prefix or use a filesystem-level read-only boundary.
- Check
.hpilot/logs/evaluation-events.jsonlfor post-run evaluation events. Cursor has no proactive enforcement mode.
Retry Continuation
"Retry continuation unavailable" in logs
This warning means a prior live continuation could not be used. OpenCode V2 restarts an owned server and tries the persisted native session before fresh fallback; other adapters report their supported fallback behavior. Common reasons:
adapter_does_not_support_continuation— The adapter for this stage does not have a native session-resume mechanism. Claude, Codex, OpenCode, and Antigravity support continuation; other adapters fall back to fresh retries. This is expected and does not indicate a problem.no_prior_session_id— The previous attempt did not capture a session ID (e.g., the adapter crashed before the session was established). The retry starts a new session instead.conversation_unavailable— Antigravity requested the saved session, and the ACP server reported that the session was missing. The pipeline records the fallback and may start one fresh session.serve_process_exited_with_code_<n>— OpenCode-specific. The prior owned server exited. Harness Pilot starts a new owned server and attempts persisted session reattachment; configuration-evidenced failure instead stops immediately.serve_health_check_failed— OpenCode-specific. The owned server is not usable through its V2 identity/session probes. Harness Pilot restarts it for persisted reattachment; auth failure is explicit, not a silent fresh fallback.
Recoverable retries still use the configured stage budget. A confirmed native reattachment is reported as continued; an unavailable native session is reported as fresh fallback. Do not infer that a restarted OpenCode server lost its session history.
Harness configuration is rejected on the first attempt
If the log reports Harness configuration rejected by <harness>, the selected harness or provider rejected a deterministic setting such as the model or effort value. Harness Pilot reports the native diagnosis, records one failed attempt, and does not retry the same configuration. It also does not run the stage's after_stage hook or persist resumable session metadata for that failed stage.
- For an explicit effort, check the selected model/provider documentation and correct
model_effortorstage_overrides.<stage>.effort. - For Cursor, remove the explicit effort; Cursor has no effort channel and is blocked before launch with
does not support model effort selection. - For OpenCode, inspect the serve diagnostic tail in stderr and the stage JSONL log under
.hpilot/logs/stages/. - Run
hpilot doctorafter correcting the configuration. Doctor checks structural readiness, while the harness or provider remains the authority on model-specific settings. - For native Codex goal mode, use an SDK exposing the required goal protocol and
codex-cli0.158.0 or newer. Verify that the effective harness is Codex at every enabled threshold. Check.hpilot/goal.mdfor the original stage instructions and the stage JSONL for status and shutdown diagnostics. Setgoal: falseto disable goal mode for future attempts once active work has stopped.
Retry appears to restart from the beginning
If the adapter does not support retry continuation, each retry starts a new agent session with the original prompt. Claude, Codex, OpenCode, and Antigravity can reuse their captured sessions when available. To reduce duplicated work on retry, consider reducing max_retries or restructuring the stage into smaller units.
Codex completed its goal but the stage contract is missing
After Codex completes a native goal, Harness Pilot checks the stage contract. If a correction is needed and another attempt is available, Harness Pilot sends it as a message to the goal's Codex thread before reactivating the same goal. The message lists the missing tasks or fields and includes the YAML examples. You can inspect the validation details in .hpilot/logs/evaluation-events.jsonl. The same behavior applies to a session shared with the Codex app. The stage retry limit and the goal's existing token and usage limits still apply. If the runtime rejects message delivery or goal reactivation, check the reported error before resuming.
OpenCode V2 startup, idle, and observation failures
- Missing or incompatible CLI: Follow the OpenCode setup guide.
servehas no--standaloneflag; clientdebug configand nativesession list/exportneed it. HTML HTTP 200 is not API readiness. Upgrade a CLI missing required native capabilities instead of substituting V1 routes. - Authentication or model rejection: Owned-server credentials are process-local and separate from provider authentication. Unknown models/variants, conflicting policies, malformed config, or failed yieldshell readiness stop before model work and are not repeatedly retried. Check the configured provider and its advertised variants; never paste secrets into diagnostics.
idle_timeout_failed: No global heartbeat or owned-session activity arrived for the default 600-second silence window. Inspect the last redacted stage JSONL events. Unrelated sessions do not extend this deadline; heartbeats prove stream liveness, not model progress.- EOF or stream error: Both use bounded observation reconnects, up to three per turn, with
sse_transport_reconnecteddiagnostics. EOF is not successful completion or a reason to wait 600 seconds. Recovery never resends the accepted prompt; unknown admission status is explicit. Inspect native history before retrying side effects. - Cancellation: Use
hpilot cancel <task-id>or Ctrl+C on an owned foreground run. Native interrupt and verified owned-tree shutdown bypass final usage waits and keep-alive. Do not use raw kills, process-name scans, or lock deletion to fix a fixture.
hpilot doctor checks prerequisites, not a running owned server's liveness or complete V2 acceptance. The dated verification report records real-provider and protocol results.
Resumed Stage Continuation
"Last session available but adapter does not support continuation"
This message means Harness Pilot found a persisted session id from the previous run but the current adapter cannot resume sessions. The stage starts as a fresh attempt. The full log line is [<stage>] Last session available but adapter '<name>' does not support continuation; starting fresh. This is expected for adapters other than Claude, Codex, OpenCode, and Antigravity.
"Last session not reusable" in logs
This message means Harness Pilot found persisted session metadata but it did not match the current invocation. Common reasons:
- No persisted metadata (
no_session_metadata) — There is no.hpilot/latest-session.jsonin the workspace (e.g., the previous run never captured a session id, or the file was deleted). The stage starts as a fresh attempt. - Stage name mismatch (
stage_mismatch) — You resumed at a different stage than the one that captured the session id. - Adapter name mismatch (
adapter_mismatch) — The current adapter differs from the one that captured the session id (for example, you changedharnessor the stage has astage_overridesharness override). - Workspace root mismatch (
workspace_mismatch) — You are running from a different working directory than the original run. - Empty session id (
empty_session_id) — The persisted metadata is structurally valid but contains a blanksession_id. Treat it as no metadata available and start fresh. - Invalid stage visit (
invalid_stage_visit) — The persisted stage visit is not a positive integer. The stage starts fresh rather than selecting an undefined iteration threshold. - Model mismatch (
model_mismatch) — The current model differs from the one that captured the session id. - Effort mismatch (
runtime_mismatch) — The current effort differs from the one that captured the session id. - Goal-mode mismatch (
goal_mismatch) — The current Codex goal mode differs from the one that captured the session id. - Persisted session not reusable (
persisted_continuation_unavailable) — Metadata matched, but the native session is missing from the selected OpenCode store. A new server alone is not a reason for fallback: V2 can reopen the persisted session after restart. Keep the same identity/XDG roots. Auth/transport errors remain explicit failures rather than fresh fallback.
In all cases, the stage starts as a fresh attempt. To reuse the session, resume at the same stage with the same adapter, model, effort, and goal mode from the same working directory and use --resume.
After metadata matches, Codex goal mode regenerates .hpilot/goal.md before reopening the thread. A missing native goal or mismatched thread id is a fail-closed execution error rather than a fresh-goal fallback.
--resume fallback preserves .hpilot/latest-session.json
When --resume is set and the resume falls back to a fresh attempt, the new session id is not written to .hpilot/latest-session.json. The original persisted metadata stays in place so a follow-up --resume still points at the persisted session id (the one captured by the last successful run). The fresh-fallback log line (SessionResumeFallback with fallback_reason: persisted_continuation_unavailable or one of the mismatch reasons) is the audit signal.
If the metadata file is missing entirely when --resume is requested, the fresh-fallback path also does not create a new file. The file is written only when a normal (non-resume) run starts a new session.
--resume requires a start stage
If you run hpilot run "task" --resume without --start-from, the command exits with a clear error:
--resume requires --start-from to specify which stage to resume at.No pipeline state or adapter session is created.
Pipeline and Contract Errors
Agent receives a contract correction
Read the outstanding work first, then check the specified YAML file against the example for the selected status. Harness Pilot reports the issues it can identify in one correction.
| What the correction shows | How to finish the stage |
|---|---|
| Outstanding tasks | Complete each listed task, then record its exact text in the Completed Tasks YAML list. A partial list produces only the missing items. A missing or non-list field produces the full task list. |
Missing or invalid Status | Use the capitalized YAML key Status. Choose the outcome that matches the work, then follow its row in the status table. |
| Fields to complete | Write a non-empty string for each listed field using its description. Use the configured field name exactly. |
| Unexpected fields | Remove the named keys. The selected route's example shows which fields belong in the artifact. |
| Missing, unreadable, or malformed artifact | Finish any outstanding stage work and checks, then write a readable YAML mapping at the specified path. |
The correction includes one <contract_guidance> block with a complete example for each status. If the agent exhausts max_retries before producing a valid artifact, the stage fails. Check .hpilot/logs/stages/ for the correction messages.
Stage fails with "Prompt template is missing required context keys"
The prompt_template for a stage references a placeholder like {key} that is not available in the rendering context. Common causes:
- Typo in the placeholder name — check that the key exactly matches the context variable (e.g.,
{objective},{stage_name}). - Using a key from a different stage — some context variables (like injections) are only available on stages that receive them from a previous stage's contract route.
- Removed a field from
contract.fields— if an injection referenced inprompt_templatewas removed fromcontract.fields, the key is no longer available.
The error message lists both the missing keys and the available keys. Fix the prompt_template in hpilot.yaml to use only available context keys.
Verifier returns block after every run
The verifier LLM is rejecting stage completion. Common causes:
The verifier model is too restrictive. Try a different model in
~/.hpilot/config.yaml.The stage contract artifact is malformed. Inspect the artifact under
.hpilot/contracts/artifacts/and compare it to the expected schema. Contract-enabled stages validate locally — everyblockfrom a contract stage is a local decision, not a verifier response.The verifier endpoint is unreachable. Check
hpilot doctor.llm.api_keyis missing or empty. A task with an effective non-contract agent stage fails preflight in this case, while the daemon itself continues running. Contract-only and command-only slices do not require the verifier.
For testing with deterministic approvals, use the mock LLM API:
python3 scripts/.e2e_mock_llm_api.py --hook-mode allow &
# Then point llm.base_url at the printed URLConfiguration Validation
hpilot validate fails with route errors
Common issues (each exits 2 with a message naming the stage and field):
- A contract stage defines a top-level
next_stage— contract stages must usecontract.routesonly. - An
injectionsfield is not declared incontract.fieldsorcontract.field_definitions. - A contract contains an unknown field (only
fields,field_definitions,field_descriptions,required_tasks, androutesare accepted); unknown keys are rejected at load time with a message listing the offending field(s). - A route key does not match any
Statusvalue guidance in the prompt template.
Run with --show-guidance to preview the exact instructions generated for the agent (exit code remains 2 on failure):
hpilot validate --show-guidanceContract route references unknown stage
If a next_stage value in contract.routes or a stage-level next_stage references a stage name that does not exist in the stages list, hpilot validate catches this at config load time and raises a descriptive error. Fix the typo in hpilot.yaml and re-run hpilot validate.
The pipeline runner also has defense-in-depth handling: if an invalid next_stage reaches the runtime, the runner logs an error and aborts gracefully instead of crashing.
Encoding and Locale
Encoding issues in agent output
If agent subprocess output contains garbled characters or encoding error messages:
- Set
PYTHONIOENCODING=utf-8before running thehpilotcommand:bashexport PYTHONIOENCODING=utf-8 hpilot "your prompt" - Verify your locale supports UTF-8:
locale charmapshould reportUTF-8.