Skip to content

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

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#7990
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.), mirroring their pattern — 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) so the registration + handler get real Codecov-measured coverage — a subprocess spawn can't be v8-instrumented (that's what left prior 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 99.

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

(Supersedes #7987, base-conflicted when #7977 merged mid-review — rebased onto current main.)

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:45
@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 (b9aa25f) to head (38496a0).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7990      +/-   ##
==========================================
- Coverage   91.91%   82.02%   -9.89%     
==========================================
  Files         739       95     -644     
  Lines       75845    24085   -51760     
  Branches    23016     4609   -18407     
==========================================
- Hits        69712    19756   -49956     
+ Misses       5041     4132     -909     
+ Partials     1092      197     -895     
Flag Coverage Δ
shard-1 11.96% <100.00%> (-42.31%) ⬇️
shard-2 0.00% <0.00%> (-53.69%) ⬇️
shard-3 0.00% <0.00%> (-55.24%) ⬇️

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 11.96% <100.00%> (-5.10%) ⬇️

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

Warning

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-22 01:54:14 UTC

3 files · 1 AI reviewer · no blockers · CI green · dirty

⏸️ Suggested Action - Manual Review

Review summary
This PR adds the missing local stdio MCP tool for `loopover_propose_action`, mirroring the existing remote tool and `maintain propose` CLI exactly: same input shape (`proposeActionShape`), same POST target (`{repoBase}/agent/pending-actions`), same `stripUndefined` body pattern used by every other stdio tool in this file. The added test drives the tool in-process via `InMemoryTransport` (the established #7764 pattern for getting real coverage on a registration block that a subprocess spawn can't instrument) and asserts the actual POST body was forwarded correctly. The tool-count invariant bump (98→99) is correctly reflected in both the count assertions and the changelog-style comment block in `mcp-tool-rename-aliases.test.ts`.

Nits — 6 non-blocking
  • The flagged secret at test/unit/mcp-cli-propose-action.test.ts:31 is a hardcoded fixture value (`"in-process-token"`) for a local test server, not a real credential — no rotation needed, but worth a `// test fixture` comment to pre-empt future secret-scanner false positives.
  • packages/loopover-mcp/bin/loopover-mcp.ts:381-385 hardcodes the 500/60000 length caps inline; since the comment says these mirror the remote shape in src/mcp/server.ts, a shared constant (or at least a citation of the remote line) would make future drift between the two shapes easier to catch.
  • The new handler at packages/loopover-mcp/bin/loopover-mcp.ts:3030 keeps the file's existing `async (...): any) =>` typing convention rather than a typed destructure — consistent with the rest of the file, so not worth fixing in isolation, but flagging since it's the pattern being propagated.
  • Consider adding one test case that omits all optional fields (reason/label/reviewBody/mergeMethod/closeComment) to explicitly assert `stripUndefined` drops them from the POST body, since the current test only covers the case where `reason`/`label` are present.
  • If `proposeActionShape`'s per-action-class field requirements (e.g. `label` required only when `actionClass === "label"`) are enforced server-side only, a one-line comment noting that the client intentionally does no cross-field validation here would help future readers avoid assuming it's missing.
  • Possible secret-shaped assignment in the diff (generic_secret_assignment) — Verify the value is not a real credential.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured 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 · LLM: moderate
Linked issue satisfaction

Addressed
The PR adds a registerStdioTool block for loopover_propose_action mirroring the sibling pattern, POSTs to the same /agent/pending-actions route used by the maintain propose CLI command with the same stripUndefined body, uses stdioToolDescription for its description, and updates the tool-count invariant tests along with dedicated coverage.

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

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