Skip to content

feat(mcp): register loopover_watch_issues as a local stdio tool - #7961

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
real-venus:feat/watch-issues-stdio-tool-7763
Jul 21, 2026
Merged

feat(mcp): register loopover_watch_issues as a local stdio tool#7961
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
real-venus:feat/watch-issues-stdio-tool-7763

Conversation

@real-venus

Copy link
Copy Markdown
Contributor

Summary

Closes #7763loopover_watch_issues has a remote MCP tool (src/mcp/server.ts) and a watch CLI command, but no local stdio MCP tool registration. #6746 added the REST route + CLI but never the matching stdio tool, so a self-host operator using the local MCP server (not the CLI or remote MCP) couldn't call it.

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

  • Extracts the /v1/contributors/:login/watches dispatch into a shared watchIssuesRequest helper (list=GET, watch=POST, unwatch=DELETE) and reuses it in both the watch CLI and the new stdio tool — so there's no duplicated HTTP logic (the CLI previously inlined the three calls).
  • A registerStdioTool("loopover_watch_issues", …) block next to the other contributor-scoped tools, mirroring the sibling pattern. login resolves from arg / active session / LOOPOVER_LOGIN (same as the CLI); action defaults to list; watch/unwatch require repoFullName.
  • Description centralized via stdioToolDescription(...) + a STDIO_TOOL_DESCRIPTORS entry (category: "utility").
  • watchCli is now exported (exactly like maintainCli, loopover_plan_repo_issues has no REST route, CLI command, or local stdio MCP tool #7764) purely so a test can drive it in-process.

Testing / coverage

  • test/unit/mcp-cli-watch-issues.test.ts runs everything 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, the shared helper, and the refactored CLI call sites all get real Codecov-measured coverage — a subprocess spawn can't be v8-instrumented:
    • stdio tool: all three actions (list/watch/unwatch → GET/POST/DELETE), with/without-labels POST bodies, and both throw branches (no login; watch/unwatch missing repoFullName).
    • watch CLI driven in-process (list/add/remove) so the shared-helper call sites are covered.
  • The existing test/unit/mcp-cli-watch.test.ts (8 subprocess CLI tests) still passes unchanged — the helper preserves the exact request bodies it asserts.
  • Tool-count invariant in test/unit/mcp-tool-rename-aliases.test.ts bumped to 92.

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

(Supersedes #7957 (codecov gap — now closed via in-process CLI coverage) and #7959 (base conflict — now rebased onto current main).)

loopover_watch_issues has a remote MCP tool (src/mcp/server.ts) and a `watch`
CLI command, but no local stdio MCP tool registration. JSONbored#6746 added the REST route
+ CLI but never the matching stdio tool, so a self-host operator using the local
MCP server couldn't call it.

Extracts the /v1/contributors/:login/watches dispatch (list=GET, watch=POST,
unwatch=DELETE) into a shared watchIssuesRequest helper reused by BOTH the `watch`
CLI and the new stdio tool -- no duplicated HTTP logic. login resolves from arg /
active session / LOOPOVER_LOGIN like the CLI; action defaults to list.

test/unit/mcp-cli-watch-issues.test.ts drives it in-process (JSONbored#7764 entrypoint
guard) so the registration + helper get real Codecov coverage, including all three
actions, the with/without-labels POST bodies, and both throw branches. Existing
mcp-cli-watch.test.ts still passes against the refactored CLI. Count 89 -> 90.

Closes JSONbored#7763
@real-venus
real-venus requested a review from JSONbored as a code owner July 21, 2026 23:47
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.96%. Comparing base (3790ecd) to head (fb6a824).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7961      +/-   ##
==========================================
- Coverage   91.84%   81.96%   -9.89%     
==========================================
  Files         735       91     -644     
  Lines       75462    23707   -51755     
  Branches    22956     4551   -18405     
==========================================
- Hits        69309    19431   -49878     
+ Misses       5071     4065    -1006     
+ Partials     1082      211     -871     
Flag Coverage Δ
shard-1 0.00% <0.00%> (-58.47%) ⬇️
shard-2 13.25% <100.00%> (-38.89%) ⬇️
shard-3 0.00% <0.00%> (-50.00%) ⬇️

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 13.25% <100.00%> (-1.65%) ⬇️

... and 644 files with indirect coverage changes

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 21, 2026
@loopover-orb

loopover-orb Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-21 23:54:58 UTC

3 files · 1 AI reviewer · no blockers · readiness 82/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This adds a stdio-registered loopover_watch_issues tool that mirrors the existing remote MCP tool and `watch` CLI, refactoring the three GET/POST/DELETE call sites into a shared watchIssuesRequest helper used by both the new tool and the CLI. The refactor preserves the CLI's exact request shapes (verified by the untouched subprocess test suite still passing), and the new in-process test exercises all three actions plus both throw branches with real coverage. The tool-count pin bump (91→92) and the login-resolution/repoFullName-required guards match the sibling contributor-scoped tools' pattern.

Nits — 5 non-blocking
  • The 'generic_secret_assignment' flag at test/unit/mcp-cli-watch-issues.test.ts:48 is a test fixture token string (`"in-process-token"`), not a real secret — worth double-checking but almost certainly a false positive.
  • packages/loopover-mcp/bin/loopover-mcp.ts: the new `watchIssuesShape` bounds (3/200/50) are copied from sibling shapes without a shared named constant, consistent with existing style in this file but still a repeated magic-number pattern.
  • The `any`-typed destructured handler args (`{ login, action, repoFullName, labels }: any`) match the file's existing convention for other registerStdioTool callbacks, so this isn't a new pattern introduced by this diff.
  • Consider whether `watchIssuesRequest`'s untyped `login`/`action` params could be narrowed to the zod-inferred shape rather than `any`, matching stricter tools elsewhere if any exist (nit only, matches file-wide convention).
  • 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 #7763
Related work ⚠️ 1 scoped overlap Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High 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), 51 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("loopover_watch_issues", ...) block using the same pattern/description helper as the cited sibling tools, and refactors the HTTP calls into a shared watchIssuesRequest helper reused by both the CLI and the new stdio tool, satisfying the no-duplicated-logic requirement. It also updates tool-count invariant tests and adds a dedicated in-process test file mirroring the

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).
  • Related work: Titles/paths share 6 meaningful terms. (PR #7962)
Contributor next steps
  • Start here: Review top overlaps.
  • Then work through the remaining 2 steps in the Signals table above.
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 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 43099df into JSONbored:main Jul 21, 2026
12 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 22, 2026
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Register loopover_watch_issues as a local stdio MCP tool

1 participant