Repository navigation
Conversation
omp is a pi-family harness that ships a task/wait subagent facility, so skills that fan out review subagents (vuln-scan, triage) run at full capability on it instead of degraded as on pi. Headless runs use `omp --mode json -p` with extension/skill/rule discovery, LSP, PTY and prewalk model-switching disabled for deterministic single-model sessions; Claude-style Task grants map onto omp's task+wait tools; full-permission mode auto-approves the coding + subagent toolset (omp's browser, github, web and ask tools stay disabled — headless audit runs have no interactive counterpart and no network egress). The JSON event parser handles the pi-family stream differences: usage rides turn_end, tool names appear only on tool_execution_* events, advisor_cost_changed is bookkeeping, and there is no agent_settled — the last turn_end is the run result. Verified against omp 18.12.6, including a headless subagent fan-out round trip and a full vuln-scan through the runner (journal, budget bands, artifact discovery). 💘 Generated with Crush Assisted-by: Crush:rits/zai-org/glm-5-3
Code Review by Qodo
1. Scoped shell grants allow any command
|
| if sb.Len() == 0 { | ||
| return Event{}, false | ||
| } | ||
| ev := Event{Kind: EventText, Text: sb.String()} |
There was a problem hiding this comment.
omp repeats the assistant's answer three times: text_delta streams it, message_end re-emits it complete, turn_end emits it again as the result — and the monitor appends all three. Drop the assistant branch here (recognize-and-ignore; pi ≥1.4 does exactly that, see the turn_end note in pi.go) — turn_end already carries content + usage.
| sb.WriteString(block.Text) | ||
| } | ||
| } | ||
| ev.Text = sb.String() |
There was a problem hiding this comment.
omp's usage is per-message, not cumulative (its session-stats sums assistant messages), but the runner's applyEvent maxes token counts — multi-turn runs undercount spend and can miss the refuse budget band. Keep running totals in the adapter and emit cumulative values.
| } | ||
| case "tool_execution_start": | ||
| return Event{Kind: EventToolCall, Tool: m.ToolName}, true | ||
| case "tool_execution_end": |
There was a problem hiding this comment.
The task tool's result payload carries per-subagent usage (omp folds details.results usage into session totals); discarding it means fan-out spend never reaches budget bands — this PR's headline capability escapes accounting. Parse the task result and fold its usage into the adapter's running totals.
| add("web_search") | ||
| } | ||
| } | ||
| if len(out) == 0 { |
There was a problem hiding this comment.
Fail-open: a skill declaring only unmappable tools (e.g. AskUserQuestion) gets the full bash/edit/write set in an ordinary run — contra SECURITY.md's fail-closed permissions. Return a minimal read-only set instead; note pi.go:63 shares this, worth fixing both.
| for _, grant := range allowed { | ||
| name := grant | ||
| if i := strings.IndexByte(name, '('); i > 0 { | ||
| name = name[:i] |
There was a problem hiding this comment.
Bash(git clone:*) silently widens to unrestricted bash — a scoped grant becomes full shell without full-permission consent. If omp's --tools can't express command scopes, surface the widening in Notes() (or refuse scoped grants); pi.go shares this too.
Summary
omp(oh-my-pi) harness adapter so skills that fan out review subagents (vuln-scan,triage) run at full capability on omp'stask/waitsubagent facility, instead of degraded as on piomp --mode json -pwith extension/skill/rule discovery, LSP, PTY and prewalk model-switching disabled — deterministic single-model sessions with no config pickup from the surrounding filesystem (S9)Taskgrants map ontotask+wait; full-permission mode auto-approves the coding + subagent toolset (read,bash,edit,write,glob,grep,task,wait,todo) — omp's browser/github/web/ask tools stay disabled (no interactive counterpart, no network egress for headless audits)turn_end, tool names only ontool_execution_*events,advisor_cost_changedis bookkeeping, noagent_settled(lastturn_endis the result)Verification
go vetclean, full suite passes (99 tests incl. newomp_test.gocommand/mapping/event tests built from real captured omp 18.12.6 streams)task+waitexecuted, correct output)vuln-scanthrough the runner on a real target: journal, budget bands, artifact discovery and validation all correct💘 Generated with Crush