Skip to content

feat(mcp): register loopover_propose_action as a local stdio tool - #7993

Closed
real-venus wants to merge 1 commit into
JSONbored:mainfrom
real-venus:feat/propose-action-stdio-tool-7753
Closed

feat(mcp): register loopover_propose_action as a local stdio tool#7993
real-venus wants to merge 1 commit into
JSONbored:mainfrom
real-venus:feat/propose-action-stdio-tool-7753

Conversation

@real-venus

Copy link
Copy Markdown
Contributor

Summary

Closes #7753loopover_propose_action has a remote MCP tool (src/mcp/server.ts) and a maintain propose CLI command, but no local stdio MCP tool registration. #6744 added the REST route + CLI but never the matching stdio tool.

What changed (packages/loopover-mcp/bin/loopover-mcp.ts)

  • A registerStdioTool("loopover_propose_action", …) block, placed next to the maintain-adjacent siblings (loopover_list_pending_actions et al.) — POSTs to the same {repoBase}/agent/pending-actions route the maintain propose CLI already calls, with the identical stripUndefined({pullNumber, actionClass, reason, label, reviewBody, mergeMethod, closeComment}) body (absent optionals omitted).
  • Stages the action into the approval queue; the route never executes it until a maintainer approves. Input proposeActionShape mirrors the remote (same actionClass enum + bounds). Description via stdioToolDescription(...); category: "agent".

Testing / coverage

  • test/unit/mcp-cli-propose-action.test.ts drives it in-process (the loopover_plan_repo_issues has no REST route, CLI command, or local stdio MCP tool #7764 isProcessEntrypoint guard + InMemoryTransport) for real Codecov-measured coverage — a subprocess spawn can't be v8-instrumented (that's what left prior third-party attempts at this exact tool at 0.00% patch). Asserts the POST /v1/repos/owner/repo/agent/pending-actions and that the serialized body (echoed by the fixture) carries the right actionClass/pullNumber/reason.
  • Tool-count invariant bumped to 100.

No REST/OpenAPI/CLI-surface change — ui:openapi:check, command-reference:check, docs/manifest drift all clean; build:mcp clean.

(Rebased onto current main after repeated sibling-PR merges base-conflicted the earlier attempts #7987/#7990.)

loopover_propose_action has a remote MCP tool (src/mcp/server.ts) and a `maintain
propose` CLI command, but no local stdio MCP tool registration. JSONbored#6744 added the
REST route + CLI but never the matching stdio tool.

Adds the registerStdioTool block mirroring the maintain-adjacent sibling pattern
(loopover_list_pending_actions et al.) -- POSTs to the same
{repoBase}/agent/pending-actions route the CLI hits, with the identical
stripUndefined body so absent optional fields are omitted. Stages the action into
the approval queue; the route never executes it until a maintainer approves. Input
mirrors the remote proposeActionShape; description via stdioToolDescription;
category "agent".

test/unit/mcp-cli-propose-action.test.ts drives it IN-PROCESS (JSONbored#7764 entrypoint
guard + InMemoryTransport) so the registration + handler get real Codecov-measured
coverage -- a subprocess spawn can't be v8-instrumented. Count 97 -> 98.

Closes JSONbored#7753
@real-venus
real-venus requested a review from JSONbored as a code owner July 22, 2026 01:57
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.02%. Comparing base (6a55b8d) to head (f2ee393).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7993      +/-   ##
==========================================
- Coverage   91.91%   82.02%   -9.90%     
==========================================
  Files         739       95     -644     
  Lines       75850    24089   -51761     
  Branches    23019     4609   -18410     
==========================================
- Hits        69717    19758   -49959     
+ Misses       5041     4134     -907     
+ Partials     1092      197     -895     
Flag Coverage Δ
shard-1 12.03% <100.00%> (-46.81%) ⬇️
shard-2 0.00% <0.00%> (-46.84%) ⬇️
shard-3 0.00% <0.00%> (-56.29%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/loopover-mcp/bin/loopover-mcp.ts 12.03% <100.00%> (-5.18%) ⬇️

... and 644 files with indirect coverage changes

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 22, 2026
@loopover-orb

loopover-orb Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - reject/close recommended

Review updated: 2026-07-22 02:05:47 UTC

3 files · 1 AI reviewer · 1 blocker · CI green · dirty

🛑 Suggested Action - Reject/Close

Review summary
This PR adds a `loopover_propose_action` stdio tool that mirrors the existing remote MCP tool's input shape and POSTs to the same `agent/pending-actions` route the `maintain propose` CLI already calls, following the same registration pattern used by numerous prior sibling tools (list_pending_actions, decide_pending_action, etc.) in this file. The in-process InMemoryTransport test actually drives the registered tool through the real dispatcher and asserts on the forwarded URL/method and echoed body fields, which is the same coverage pattern the PR description says fixed a prior 0% patch-coverage rejection. The change is narrow, well-targeted at the linked issue (#7753), and the tool-count invariant bump (99→100) is consistent across both affected test files.

Nits — 6 non-blocking
  • `proposeActionShape.actionClass` in loopover-mcp.ts:381 hardcodes the enum values as a string-literal array instead of reusing the already-declared `PROPOSE_ACTION_CLASSES` constant a few hundred lines above — same values, but a future addition to one won't propagate to the other; worth a `z.enum(PROPOSE_ACTION_CLASSES as [string, ...string[]])` or equivalent.
  • The external brief's 'leaked secret' flag on test/unit/mcp-cli-propose-action.test.ts:31 is a false positive — `LOOPOVER_API_TOKEN = "in-process-token"` is an obvious test fixture placeholder, consistent with `LOOPOVER_TOKEN: "session-token"` used in the neighboring mcp-cli-maintain-tools.test.ts.
  • The `any`-typed handler params (`loopover-mcp.ts:3047`) match the pre-existing convention used by every other `registerStdioTool` callback in this file, not a new pattern introduced here.
  • Magic numbers 500/60000 for `reason`/`reviewBody`/`closeComment` max lengths mirror the remote schema per the adjacent comment, but a short inline note on why those specific bounds were chosen (rather than just 'mirrors remote') would help future editors avoid drifting them independently.
  • Extract `proposeActionShape`'s actionClass enum from `PROPOSE_ACTION_CLASSES` to guarantee the two never diverge, the same way `MAINTAIN_ACTION_CLASSES` is reused elsewhere in the file.
  • Possible secret-shaped assignment in the diff (generic_secret_assignment) — Verify the value is not a real credential.

Why this is blocked

  • No linked issue detected: The PR cites an issue number, but it could not be verified as a currently open issue. — If this PR is intended to solve an issue, link it explicitly in the PR body.
📋 Copy for AI agents — paste into your coding agent
Fix the following blocker(s) from this PR review:

1. No linked issue detected: The PR cites an issue number, but it could not be verified as a currently open issue. — If this PR is intended to solve an issue, link it explicitly in the PR body.

Decision drivers

  • ❌ Code review — 1 blocker (1 reviewer)
  • ❌ Gate result — Blocking (Repo-configured hard blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #7753
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 112 registered-repo PR(s), 50 merged, 19 issue(s).
Contributor context ✅ Confirmed Gittensor contributor real-venus; Gittensor profile; 112 PR(s), 19 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Linked issue satisfaction

Addressed
The PR adds a registerStdioTool("loopover_propose_action", ...) block following the exact sibling pattern, reusing the same {repoBase}/agent/pending-actions POST call and stripUndefined body as the CLI's maintain propose command, with description sourced via stdioToolDescription and the tool-count invariant tests updated accordingly.

Review context
  • Author: real-venus
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: TypeScript, JavaScript, Python, Rust, CSS, MDX, Svelte, Swift
  • Official Gittensor activity: 112 PR(s), 19 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask 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.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 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.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (conflicts with the base branch — resolve and open a fresh PR; No linked issue detected). 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.

@loopover-orb loopover-orb Bot closed this Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Register loopover_propose_action as a local stdio MCP tool

1 participant