Skip to content

feat(mcp): register loopover_get_automation_state as a local stdio tool - #7966

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
andriypolanski:fix/7752
Jul 22, 2026
Merged

feat(mcp): register loopover_get_automation_state as a local stdio tool#7966
JSONbored merged 1 commit into
JSONbored:mainfrom
andriypolanski:fix/7752

Conversation

@andriypolanski

Copy link
Copy Markdown
Contributor

Closes #7752

Summary

  • loopover_get_automation_state was a remote MCP tool (src/mcp/server.ts) with a maintain automation-state CLI mirror (REST + CLI mirror for loopover_get_automation_state #6742), but had no local stdio MCP tool registration.
  • This registers the missing stdio tool next to its maintain-family siblings, calling the same GET ${toolRepoBase(owner, repo)}/automation-state endpoint the CLI already uses.

Closes #7752

Change

Tests

  • New test/unit/mcp-cli-automation-state-stdio.test.ts: in-process InMemoryTransport coverage — tool registers and proxies GET .../automation-state (this is what Codecov instruments).
  • test/unit/mcp-cli-maintain-tools.test.ts: added to MAINTAIN_TOOLS (6 → 7), capture regex includes automation-state.

Validation

  • git diff --check clean; npm run build:mcp clean.
  • Targeted vitest suites pass (automation-state in-process, maintain-tools, tools list, rename-aliases).
  • Codecov patch = 100%. Verified from coverage-final.json that every added executable line is hit and there are zero branches on added lines.
  • Replaces closed conflicted feat(mcp): register loopover_get_automation_state as a local stdio tool #7938 (that PR targeted a stale 87→88 pin and used a branchy ?? summary without an in-process Codecov test; this branch is based on current main at 94 tools).

@superagent-security

Copy link
Copy Markdown
Contributor

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

@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

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-22 00:34:18 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR registers the missing loopover_get_automation_state stdio tool, mirroring the existing maintain-family pattern (registerStdioTool + STDIO_TOOL_DESCRIPTORS entry + apiGet proxy) exactly as siblings like loopover_get_gate_precision do. The handler is a straightforward branch-free proxy, the tool-count pin bumps 94→95 consistently across mcp-tool-rename-aliases.test.ts, and new/updated tests exercise both the in-process registration and the CLI's maintain-tools list, including the 404 failure path via the shared parameterized loop in mcp-cli-maintain-tools.test.ts. The change is narrow, closes #7752 as stated, and follows the file's established conventions with no logic errors visible.

Nits — 6 non-blocking
  • packages/loopover-mcp/bin/loopover-mcp.ts:2991 — the handler's `async ({ owner, repo }: any) =>` uses an explicit `any` param annotation like its neighboring registerStdioTool calls in this file, so it's consistent with existing style but still loses type-checking on the destructured shape; consider typing against ownerRepoShape's inferred type if the file ever tightens this.
  • test/unit/mcp-cli-automation-state-stdio.test.ts:32 — `LOOPOVER_API_TOKEN = "in-process-token"` is a hardcoded test fixture value, not a real secret, but worth a quick glance to confirm no real token ever gets logged alongside it in CI output.
  • The tool description in loopover-mcp.ts:1472-1476 is quite long (matching the remote tool's description per the PR summary) — verify it renders acceptably in client tool-list UIs that truncate descriptions.
  • Consider extracting the shared `async ({ owner, repo }: any) => { const payload = await apiGet(...); return toolResult(...); }` shape used by several sibling maintain-read tools into a tiny helper to cut duplication, though this is optional given the file's existing per-tool style.
  • The comment above the new registerStdioTool call (loopover-mcp.ts:2981-2984) is helpful context — keep this pattern for future stdio-tool additions.
  • 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 #7752
Related work ⚠️ 3 scoped overlaps 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: 190 registered-repo PR(s), 120 merged, 22 issue(s).
Contributor context ✅ Confirmed Gittensor contributor andriypolanski; Gittensor profile; 190 PR(s), 22 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Linked issue satisfaction

Addressed
The PR registers loopover_get_automation_state as a stdio tool using the same registerStdioTool/stdioToolDescription pattern as its siblings, and the handler proxies the same GET .../automation-state endpoint the existing CLI command uses without duplicating HTTP logic.

Review context
  • Author: andriypolanski
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, JavaScript, Rust, Cuda, Kotlin, MDX, Scala
  • Official Gittensor activity: 190 PR(s), 22 issue(s).
  • Related work: Titles/paths share 10 meaningful terms. (PR #7968)
  • Related work: Titles/paths share 8 meaningful terms. (PR #7967)
  • Related work: Titles/paths share 8 meaningful terms. (PR #7968, PR #7967)
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 <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> 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

@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 81.78%. Comparing base (8c2950c) to head (a9df347).

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #7966       +/-   ##
===========================================
- Coverage   91.87%   81.78%   -10.09%     
===========================================
  Files         735       91      -644     
  Lines       75477    23716    -51761     
  Branches    22960     4551    -18409     
===========================================
- Hits        69344    19397    -49947     
+ Misses       5041     4123      -918     
+ Partials     1092      196      -896     
Flag Coverage Δ
shard-1 0.00% <0.00%> (-58.35%) ⬇️
shard-2 11.66% <100.00%> (-40.49%) ⬇️
shard-3 0.00% <0.00%> (-50.10%) ⬇️

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.66% <100.00%> (-4.73%) ⬇️

... and 644 files with indirect coverage changes

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. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Register loopover_get_automation_state as a local stdio MCP tool

3 participants