feat(mcp): add loopover-mcp agent start CLI subcommand - #8376
Conversation
Closes JSONbored#8314. Adds a start branch to runAgentCli mirroring the loopover_agent_start_run stdio tool's POST /v1/agent/runs request shape (objective/actorLogin required, --repo/--pull/--issue optional target), with surface "cli" so the CLI and MCP entry points stay distinguishable. Registers start in CLI_COMMAND_SPEC.agent and printAgentHelp. Exports runAgentCli via a separate statement (an inline export prefix breaks the spec-parity boundary regex) for in-process test coverage; adds a captured POST /v1/agent/runs harness route and full-branch CLI tests.
|
Caution 🛑 LoopOver review result - reject/close recommendedReview updated: 2026-07-24 11:08:22 UTC
Review summary Nits — 2 non-blocking
Why this is blocked
📋 Copy for AI agents — paste into your coding agentCI checks failing
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionNot yet addressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. Scroll preview
A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, changes); Linked issue does not appear to be satisfied; Patch-less file(s) could not be fully scanned for secrets (494); Possible leaked secret in the diff (private_key_block)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
…ing the PR (#9082) (#9103) incompletePatchLessSecretScanFinding emitted code "secret_leak" whenever a patch-less file's content couldn't be fetched or verified within the scan cap (a Contents API 404/5xx, a >4MB file, a rate limit, or the fetch budget being exhausted) -- sharing the code with a REAL, matched credential. secret_leak is unconditional and breaker-exempt by design (CONCRETE_EVIDENCE_BLOCKER_CODES), so an unreadable file auto-closed a legitimate PR with no live re-check ever getting a chance to clear it. Confirmed live: 4 contributor PRs were closed this way (metagraphed#4600, loopover#7155/#7431/#8376). Gives the incomplete case its own code, secret_scan_incomplete, and routes it through evaluateGateCheckCore's no-deterministic-blocker branch -- mirroring ai_review_inconclusive's existing pattern exactly, and deliberately NOT the unconditional isEvaluationBlocker check: it only holds when nothing else already hard-blocked, so a real secret_leak on a DIFFERENT file in the same PR still fails the gate rather than being buried in this new hold. Re-evaluates automatically on the next sync/push, same as pre_merge_check_unresolved. secret_leak itself is completely unchanged: a genuine match still hard-blocks unconditionally, with no opt-in. Tests: a gate-level regression pinning the neutral-vs-failure split (including the real-leak-still-fails case with both finding codes present on one PR), the end-to-end maybeAddSecretLeakFinding wiring test rewritten to assert the new code and that secret_leak is absent, and the unit-level code assertion in patchless-secret-scan.test.ts. Closes #9082

Summary
loopover-mcp agent startCLI subcommand mirroring the existing loopover_agent_start_run MCP tool #8314: adds theloopover-mcp agent startCLI subcommand — the human-typable counterpart to the existingloopover_agent_start_runstdio MCP tool, closing the one CLI/MCP parity gap the audit found.runAgentCligains astartbranch that POSTs the same/v1/agent/runsrequest shape the stdio tool sends:{ objective, actorLogin, surface, target: { repoFullName?, pullNumber?, issueNumber? } }.objectiveandactorLoginare non-optional inagentRunShape, so both are enforced (--loginresolved via the sameoptions.login ?? LOOPOVER_LOGIN ?? GITHUB_LOGINpattern asplan/packet;--objectiverequired), throwing a clear usage error when either is missing.--repo/--pull/--issuemap to the optional target fields. Output goes through the existingoutputAgentPayloadhelper (--jsonpassthrough vs. summary).surface: "cli"(not the stdio tool's"mcp"), per the issue: this keeps the two entry points distinguishable server-side — the stated goal — whereas reusing"mcp"would make them indistinguishable.startinCLI_COMMAND_SPEC.agent(so it tab-completes and passes the spec↔handler parity check) and documented it inprintAgentHelp.Tests
test/unit/mcp-cli-agent-start.test.ts— in-process coverage calling the exportedrunAgentClidirectly (a subprocess-spawned CLI run is invisible to v8/Codecov, so the existing subprocess-based agent tests can't cover a new branch): asserts the exactPOST /v1/agent/runsbody withsurface: "cli"and every target field; the empty-target case;--jsonpassthrough; missing---login, missing---objective, and valueless---objectiveusage errors; the non-start fall-through; and the help listing. 100% of the changed lines and branches, verified locally via lcov.runAgentCliis exported via a separateexport { runAgentCli }statement rather than an inlineexport async function, so the CLI_COMMAND_SPEC↔handler parity test's\n(?:async )?functionboundary regex still delimits the handler correctly (an inlineexportprefix broke that boundary and bled this handler's subcommands into the adjacentrunCacheCli's). Added a capturedPOST /v1/agent/runsroute to the CLI test harness.Scope
CONTRIBUTING.md; nosite//CNAME.Closes #8314).Validation
git diff --checknpm run typechecknpm run test:coveragelocally (100% patch coverage on the changed lines/branches, verified via lcov)npm run build:mcp,npm run test:mcp-packnpm run command-reference:check,npm run docs:drift-checktest/unit/mcp-*suite (861 tests) green, incl. the CLI_COMMAND_SPEC↔handler parity checkIf any required check was skipped, explain why:
packages/loopover-mcp/bin/loopover-mcp.tsplus test files (the CLI harness + the new in-process test). It touches no engine code, API/OpenAPI, migration, generated artifact, UI, or worker surface, so the remainingtest:cisteps (engine build/tests, workers, ui:build, db/drift checks) are unaffected. Engine was rebuilt (a stale dist otherwise breaks whole-repo typecheck), typecheck is clean, and the full mcp test surface + mcp-pack + command-reference + docs-drift all pass.Safety
printAgentHelp's existing copilot-only description.UI Evidence
Not applicable — a CLI subcommand with no visible UI, frontend, docs, or extension change.
Notes
plan/status/explain/packetsubcommands or the stdio MCP tool.surface: "cli"is the one deliberate divergence from the mirrored stdio tool, per the issue's distinguishability requirement.