You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of the epic. Depends on the runner core. Owner: gitmoot-pipe.
Change
internal/omp
Builds the argv: -p --mode json --no-session --no-skills --no-rules --no-extensions --no-lsp --no-pty --tools=<tools>, --model, --thinking, and --max-time set to about 0.9× of the time left.
stdin is /dev/null. omp reads stdin to EOF and hangs otherwise.
A streaming parser for --mode json events:
adds up usage.cost.total, input tokens and output tokens per assistant message_end;
decides success from the stream, because exit 0 is not success (port of gitmoot internal/runtime/omp.goparseOmpStreamJSON…): agent_end is present, and the last stopReason is not error, aborted, length or toolUse;
extracts the final assistant text.
Cost guard: cancels the process (group) as soon as the running total goes over max_cost. The stage then fails with over budget, and the cost so far is recorded.
Output: the runner writes output into the run work directory from the final text. It accepts pure JSON or a single fenced ```json block. Anything else fails the stage, and nothing is written.
Local executor (agent_executor: local) for development and tests:
It must be enabled explicitly and is labelled unsafe in docs and logs. It runs omp on the host with a private PI_CODING_AGENT_DIR and an exact environment.
Production uses sandboxd (next sub-issue).
Records: per-attempt cost and tokens.
Acceptance
Unit tests feed recorded omp JSON-lines fixtures: success, failed turn with exit 0, over-cap mid-stream, non-JSON final answer. The fixtures come from a real omp 18.10.4 run.
One real smoke run on the subscription with a tiny prompt writes a valid output file and records the cost.
A forced low max_cost kills the run and writes nothing.
Activity
fix: address review round 1 — cleanup ledger, gated process groups, e…
feat: stagehand v1 runner — core, omp agent stage, sandboxd executor,…