Repository navigation
✨ ioscan: accept omp as a tool-less classifier CLI backend - #15888
Conversation
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Co-authored-by: hanthor <5840441+hanthor@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
There was a problem hiding this comment.
Intent alignment (read at head ed0712b): the diff delivers what #15873 asks — omp enters cliToollessArgs with every disable flag, a dedicated profile and replaced system prompt (src/pkg/ioscan/cli_client.go:79-95), the prompt reaches omp on stdin because promptViaArg stays false (cli_client.go:258-263), and the env is base set + OMP_AUTH_BROKER_URL/TOKEN only (cli_client.go:126). Boot, config and the dashboard POST all validate through SupportsToolless, so backend: omp is accepted everywhere (cmd/hive/ioscan_classifier_boot.go:76,136, pkg/dashboard/api_governor_security.go:128).
One in-scope gap:
- Dashboard setting still presents
ompas "refused at boot". The issue's acceptance includes "Settings acceptomp", and the boot log's fix hint points operators at Settings → Security → Input Defense (ioscan_classifier_boot.go:86). That dropdown hard-codes the option list and labels anything else as refused:pkg/dashboard/static-src/js/config-watchdog-security.js:835-837(mirrored inpkg/dashboard/static/index.html:56741-56743), and the help text at:832still says only claude and copilot run tool-less. A hive onompsees its working backend flagged as refused, and the dropdown offers no way to pickomp. Fix: add anomp — tool-less CLIoption, extend the refused-condition exclusion toomp, update the help text, and regeneratestatic/index.html(makecheck atMakefile:13).
Advisory (non-blocking): TestCLIChatClientOmpLaunchIsToolless (cli_client_test.go:239) asserts every disable flag except --no-title; the issue asks the test to cover "every disable flag".
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Security review (head ed0712b) — no blocking findings.
Verified against omp 18.14.0 on this host, not just the diff:
--profile hive-ioscanresolves the agent dir to~/.omp/profiles/hive-ioscan/agent/, so anmcp.jsonplanted in the default~/.omp/agent/is not loaded (src/pkg/ioscan/cli_client.go:79-94).-pwith no positional does consume stdin as the user message, so the untrusted text never reaches argv (cli_client.go:224-229); boot fallback picks omp viaSupportsToollesswith no extra code (src/cmd/hive/ioscan_classifier_boot.go:136), matching the docs claim.- Env is base set +
OMP_AUTH_BROKER_URL/TOKENonly (cli_client.go:125-126), asserted by the new test.
Advisory (low, non-blocking): omp also exposes --no-context-files ("Disable context files (AGENTS.md, CLAUDE.md, ...)"). The empty temp cwd and fresh profile already keep them out, but the copilot spec passes the analogous --no-custom-instructions (cli_client.go:62); adding it to the omp args at cli_client.go:91-93 makes the tool-less guarantee not depend on the profile dir staying unconfigured.
— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88
…context-files Address review findings on #15888: the Settings → Security → Input Defense classifier-backend select now lists omp as a tool-less CLI instead of rendering it as refused at boot (static/index.html regenerated); the omp launch adds --no-context-files so context files stay out even if the hive-ioscan profile or cwd ever gains one; the launch test asserts --no-title and --no-context-files. Hive-Fix-Attempt: 1/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Read the diff against v5 and the launch path in cli_client.go; the wiring looks correct to me, with one open question only a live run can answer.
Verified
src/pkg/ioscan/cli_client.go:79-96addsomptocliToollessArgswithpromptViaArgleft false, soComplete(cli_client.go:191) pipes the rendered prompt on stdin exactly as it does forclaude; the untrusted text never reaches argv.cli_client.go:128allow-lists onlyOMP_AUTH_BROKER_URL/OMP_AUTH_BROKER_TOKENon top of the base set, andTestCLIChatClientOmpLaunchIsToollesschecks thatGH_TOKEN/HIVE_*/OPENAI_API_KEYdo not leak.- Every flag in the new argv exists on the omp this host runs (
omp/18.14.0 --help):--no-tools,--no-lsp,--no-extensions,--no-skills,--no-rules,--no-session,--no-title,--no-context-files,--profile,--system-prompt,--mode text,-p.--profileis documented there as "isolated profile for auth, sessions, settings, and caches", which matches the comment's isolation claim; omp also confirmed the profile-scoped broker token path (.omp/profiles/hive-ioscan/auth-broker.token) when I launched it without credentials.
Open question (not a defect — I could not verify it)
- The comment at
cli_client.go:90-91says "the prompt itself is read from stdin (-pwith no text)".omp --helpdocuments-p, --printonly as "process prompt and exit" and says nothing about stdin; the repo has no other omp headless launch to compare against (crux uses--textfor other backends), and an offline probe fails on auth before reading any prompt. The unit test uses a fake CLI, so CI cannot settle this either. Ifomp -pwith no positional prompt does not read stdin, the classifier gets an empty prompt and every verdict fails closed at boot. Whoever enablesioscan.classifier.backend: ompon a real spoke should run one classification first; if it hangs or returns nothing, the fix ispromptViaArg: true, promptFlag: "-p"as copilot does atcli_client.go:61-63.
Nothing changed, approved, or closed by me.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
…erval The test advanced the fake clock right after the previous cycle persisted, racing the loop-top reconcileOverdue check: when that check saw the clock already at +15m it enumerated there, and the buffered wake then ran as an extra cached cycle (6 sources instead of 5). Wait for the loop's post-persist clock read, i.e. until it is parked in select, before advancing time. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Test review (head d2ddb6d, the deflake commit the earlier reviews at ed0712b/e9f6856 did not see).
Verified
TestRunLoopWakeEnumeratesWhenSnapshotOlderThanIntervalread-count arithmetic matchesrunLooponv5:lastEnumerateAt := loopNow()(main.go:5889) is read 1, the loop-topreconcileOverduecheck (main.go:6143) is read 2 —serveContinuousWakereturns beforewakeNow()because this harness leavesdeps.newWakeTimernil (main.go:6103). Each cached wake then coststick's overdue check (:5907) + the loop-top read = 2, and the upgraded third wake adds thelastEnumerateAt = loopNow()stamp (:5914) = 3.reads += 2; if i == 2 { reads++ }is exact, not approximate.- The fix targets the real race: before it,
clock.advancecould land while the loop was still between<-h.persistedand the loop-top check, so the enumerate ran at the loop top and the buffered wake became a fifth, cached cycle. Waiting until the loop is parked inselectremoves that window. waitReadsuses a channel + 10s deadline, notime.Sleep— theinternal/testutilsleep ratchet stays at baseline.TestCLIChatClientOmpLaunchIsToollesscovers argv isolation flags,--profile hive-ioscan,--system-prompt,--model, prompt-on-stdin, and env (broker vars present,GH_TOKEN/HIVE_*/OPENAI_API_KEYabsent).TestSupportsToollessand the boot/dashboard paths are generic overToollessBackends(), so no further test is needed for omp to be selectable.
Note (non-blocking)
- The deflake is unrelated to #15873 and is bundled into a feature PR; the read counts are coupled to the loop's clock-read sites, so a future
loopNow()added anywhere between persist andselectwill fail this test withclock reads = N, want >= M. TheFatalfmakes that drift diagnosable, which is acceptable — flagging only so the next person to touchrunLoopknows why the test counts reads.
Nothing changed, approved, or closed by me.
🐝 Hive Agent: quality | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read src/pkg/ioscan/cli_client.go at d2ddb6d plus the existing copilot/claude specs and Complete/argv. Looks correct to me; one scope note.
- The
ompentry takes the stdin path (promptViaArgunset), so the untrusted text is piped likeclaude, never on argv —TestCLIChatClientOmpLaunchIsToollessasserts both the argv exclusion and the stdin delivery. - Env allowlist adds only
OMP_AUTH_BROKER_URL/OMP_AUTH_BROKER_TOKENon top of the base set (cli_client.go:128);GH_TOKEN/GITHUB_TOKENstay out, same as the other two backends. - I checked the
--no-tools,--no-lsp,--no-extensions,--no-skills,--no-rules,--no-title,--no-context-filesflags against upstreamcan1357/oh-my-pi(docs/cli-reference.md,packages/coding-agent/src/cli.ts); all exist. I did not independently verify--mode text,--profile,--no-session, or that-pwith no text reads stdin — open question, not a finding. - Dashboard select (
config-watchdog-security.js:836) addsompand widens the "refused at boot" fallback guard consistently.
Scope: commit d2ddb6d ("deflake TestRunLoopWakeEnumeratesWhenSnapshotOlderThanInterval") touches src/cmd/hive/reconcile_starvation_test.go, which has nothing to do with ioscan or #15873. The change itself is sound (waits on clock reads via a channel rather than racing the loop), but it is unrelated test hardening riding in a feature PR; a maintainer may prefer it split out. Not blocking.
Sign-off survives the squash is red though all three commits carry Signed-off-by; I could not determine the cause from the check summary.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read the diff against v5, plus cli_client.go (argv/env/Complete), crux/agent/manager_env.go and the upstream omp CLI reference. Looks correct to me, and it does what #15873 specifies.
- Flags are real and mean what the comment says. I checked every flag in
cli_client.go:93-95against omp'sdocs/cli-reference.md:--no-tools,--no-lsp,--no-extensions,--no-skills,--no-rules,--no-session,--no-title,--no-context-files,--system-prompt <text|file>,--mode text,-pall exist, and non-TTY stdin is read to EOF as the prompt, so leavingpromptViaArgunset (prompt via stdin,cli_client.go:231) is right. Sanity note:--system-promptaccepts<text|file>; the constant atcli_client.go:105is a sentence, not a path, so it cannot resolve to a file. - Env allowlist (
cli_client.go:128) names the sameOMP_AUTH_BROKER_URL/OMP_AUTH_BROKER_TOKENthe agent path already uses (manager_env.go:32), and the test assertsGH_TOKEN/GITHUB_TOKEN/OPENAI_API_KEYare not forwarded. - Boot acceptance flows from the
cliToollessArgsmap (SupportsToolless,cli_client.go:133), so no second list needed updating; the dashboard select and docs were updated to match.
Open question (not a defect): omp's docs say --profile isolates auth as well as settings. On a host where omp was logged in interactively in the default profile (the flow contribute_landing.go:1622 tells contributors to use) and no broker is set, the hive-ioscan profile holds no credential, so the classifier fails every call and the hive stays fail-closed. That is the same outcome as today (no backend at all), so not a regression — but with backend left empty, boot now auto-selects omp for omp-majority hives (ioscan.md:153), and an operator in that state will see per-call failures rather than the "no backend" boot line. Worth confirming the existing ioscan-classifier-blocked alert still names the fix in that case, or adding "requires the auth broker" to the boot log for omp.
Minor scope note: commit d2ddb6d deflakes TestRunLoopWakeEnumeratesWhenSnapshotOlderThanInterval in src/cmd/hive/reconcile_starvation_test.go, unrelated to omp. The change itself is sound (waits on clock-read counts instead of racing the advance), just flagging it so the squash message reflects it.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
docs-currency — read at head f89cc6c.
Docs, dashboard help text, changelog and the boot/alert/API strings (all derived from ioscan.ToollessBackends(), src/cmd/hive/ioscan_classifier_boot.go:63,163, src/pkg/dashboard/api_governor_security.go:129) are consistent with the new backend. One operator-facing gap:
src/docs/ioscan.md:193-200— omp bullet omits the auth-broker prerequisite.omp --profileis documented by omp itself as "an isolated profile for auth, sessions, settings, and caches", so the never-configuredhive-ioscanprofile (src/pkg/ioscan/cli_client.go:95,101) holds no stored login. The classifier can therefore only authenticate throughOMP_AUTH_BROKER_URL/OMP_AUTH_BROKER_TOKEN(cli_client.go:128), yet the doc only says the env "adds … (when set)". An omp hive whose agents log in interactively (no broker) will see every classification fail and, at L5–L6, every kick withheld, with nothing in the docs pointing at the cause. Suggested fix: add one sentence to the omp bullet — e.g. "omp's--profilealso isolates credentials, so the classifier needsOMP_AUTH_BROKER_URL(andOMP_AUTH_BROKER_TOKEN) in the hive's environment; a hive whose omp agents rely on an interactive login has no classifier credential and fails perclassifier.fail_mode." — and ideally the same note in the dashboard help text (config-watchdog-security.js:832).
Advisory (out of scope): the PR body does not mention the src/cmd/hive/reconcile_starvation_test.go change (loopClock read-counting), which is unrelated to #15873; a line in the body would help later readers.
— hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive filed review findings that do not block this PR as backlog items:
Cap: 10 backlog item(s) per PR per day. |
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from The flag set is real (checked every flag against Medium — an empty Open question — does Low — the diff also rewrites Everything else I read — the dashboard select in Review findings from Read the diff against the What I verified:
Open question (not a finding): I cannot verify omp's flag set (
|
…mp agents omp --profile isolates settings as well as auth, so the never-configured hive-ioscan profile has no default model: launched without --model it prints "No default model selected" with exit 0 and the classifier fails on every call while looking configured. Boot now passes the model most of the hive's omp agents run with when ioscan.classifier.model is empty, and refuses the backend with one log line (and the blocked-kick alert at fail-closed) when neither names one. claude and copilot keep their own CLI default. Also records that omp reads OMP_AUTH_BROKER_URL/TOKEN from the environment inside an isolated profile (verified against an unreachable broker), and updates ioscan.md accordingly. Hive-Fix-Attempt: 2/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Read the diff against the v5 tree, the callers of NewCLIChatClient, and the settings validator. Looks correct to me.
What I verified:
src/pkg/ioscan/cli_client.go:85-105— theompspec reads the prompt on stdin (promptViaArgunset →Completepipes it,cli_client.go:270-272), andargv()appends--modelafter the spec args (cli_client.go:228), so the launch matches the one documented insrc/docs/ioscan.md.cli_client.go:196-198—requiresModel && model == ""returns a wrappedErrCLIModelRequired; boot distinguishes it witherrors.Is(src/cmd/hive/ioscan_classifier_boot.go:94) and still runs the fail-closed/fail-open branch first (:86-93), so the alert/UnavailableClassifierbehaviour is unchanged for the new refusal.ioscan_classifier_boot.go:176-201—ioscanClassifierAgentModeliteratescfg.Agentswith the same majority-then-name ordering asioscanClassifierFallbackBackend(:148-169), so the backend and model fallbacks pick from the same population. Only consulted whencl.Modelis empty andRequiresModel(backend);claude/copilotkeep the pre-existing empty-model path.src/pkg/dashboard/api_governor_security.go:128validates viaioscan.SupportsToolless, so settings acceptompwith no further change; the<select>inconfig-watchdog-security.js:836is updated to match.- Env allowlist (
cli_client.go:147) adds only the two broker vars;TestCLIChatClientOmpLaunchIsToollessassertsGH_TOKEN/GITHUB_TOKEN/HIVE_*are absent.
The reconcile_starvation_test.go deflake is unrelated to omp but is declared as such in the body; it is test-only.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Hives whose agents all run through omp have neither a claude nor a copilot CLI, so the fail-closed ioscan classifier has no backend and every kick carrying issue or PR text is withheld. This adds omp as a third tool-less CLI backend, with the same guarantees as the others: every tool, LSP, extension, skill and rule source off, a dedicated empty settings profile, a replaced system prompt, prompt on stdin, and an env of the reduced base set plus OMP_AUTH_BROKER_URL/TOKEN (never GH_TOKEN/GITHUB_TOKEN). Budget, daily quota and fail mode are unchanged. Adds a launch test and updates docs and changelog.
Because
--profilealso isolates settings, thehive-ioscanprofile has no default model, so omp always gets--model:ioscan.classifier.modelwhen set, otherwise the model most of the hive's omp agents run with; with neither, boot refuses the backend with one log line (and the blocked-kick alert at fail-closed). omp reads the broker pair from the environment inside the isolated profile (verified against an unreachable broker).Also included, unrelated to omp:
src/cmd/hive/reconcile_starvation_test.go— deflakesTestRunLoopWakeEnumeratesWhenSnapshotOlderThanInterval, which raced the loop-topreconcileOverduecheck and failed this PR's CI (the test now waits until the loop is parked inselectbefore advancing the fake clock). Pure test change, no behaviour change.Closes #15873
— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 requested_by=@hanthor