Skip to content

mcp(cli): packages/loopover-mcp missing loopover_clear_selftune_override (sibling loopover_get_selftune_override_audit already mirrored, #7997) #9300

Description

@JSONbored

⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.

⚠️ Required pattern: mirror loopover_get_selftune_override_audit's registration in
packages/loopover-mcp/bin/loopover-mcp.ts (added by #7997 — "add remote + stdio + CLI surfaces for
the selftune override audit"), immediately above/below it in the same file, using apiDelete (already
used by the unwatch action) instead of apiGet.

Context

src/mcp/server.ts (the hosted remote MCP server) registers two selftune-override tools as a
read/write pair:

  • loopover_get_selftune_override_audit — read the override audit trail
    (GET .../selftune/overrides/audit)
  • loopover_clear_selftune_override — clear a repo's live self-tune override, requires
    confirm:true (DELETE .../selftune/overrides)

packages/loopover-mcp/bin/loopover-mcp.ts — the published local CLI/stdio MCP package — mirrors
most remote tools as local registerStdioTool wrappers over the same REST routes via apiGet/
apiPost/apiDelete helpers. #7997 added the CLI mirror for loopover_get_selftune_override_audit
(confirmed present at packages/loopover-mcp/bin/loopover-mcp.ts, both in the tool-catalog list and
in a registerStdioTool("loopover_get_selftune_override_audit", ...) block using apiGet). Its
write-side sibling, loopover_clear_selftune_override, has no entry anywhere in
packages/loopover-mcp/bin/loopover-mcp.ts — grep for clear_selftune/clearSelftune in that file
and in packages/loopover-mcp/CHANGELOG.md returns nothing. A CLI/stdio MCP user can read the
override audit trail but cannot clear an override without switching to the REST API directly.

Requirements

  • Add loopover_clear_selftune_override to the CLI tool-catalog list in
    packages/loopover-mcp/bin/loopover-mcp.ts (the array entry with name/category/description,
    same block loopover_get_selftune_override_audit's catalog entry lives in), category
    "maintainer".
  • Add a registerStdioTool("loopover_clear_selftune_override", ...) block, placed next to
    loopover_get_selftune_override_audit's block, using stdioToolDescription(...) for the
    description and an input shape matching the remote tool's (owner, repo, confirm: boolean).
  • Handler: call apiDelete(${toolRepoBase(owner, repo)}/selftune/overrides, { confirm }) (the
    apiDelete helper already exists and is used by the unwatch action) and return the result via
    toolResult(...), matching the remote tool's confirm:true requirement — do not silently default
    confirm to true; an omitted/false confirm must be rejected the same way the remote tool
    rejects it.
  • No OpenAPI/schema regeneration required: DELETE /v1/repos/:owner/:repo/selftune/overrides is an
    unchanged REST route — this issue only adds the CLI's local mirror of an MCP tool that already
    exists on the hosted server.

Deliverables

  • loopover_clear_selftune_override added to the CLI tool catalog in
    packages/loopover-mcp/bin/loopover-mcp.ts.
  • registerStdioTool("loopover_clear_selftune_override", ...) wired to apiDelete, requiring
    confirm:true the same way the remote tool does.
  • Unit/integration test covering the happy path and the missing/false-confirm rejection path.

All deliverables are required in this one PR — there is no follow-up issue.

Test Coverage Requirements

99%+ Codecov patch target (codecov/patch, unsharded via npm run test:coverage) on every branch of
the new CLI tool registration, including the confirm-rejection branch. Add a regression test
asserting the CLI tool calls DELETE {repoBase}/selftune/overrides with the same query/body shape
the remote loopover_clear_selftune_override tool sends.

Expected Outcome

A loopover-mcp CLI/stdio user can clear a repo's live self-tune override the same way they can
already read its audit trail, closing the read/write asymmetry between the two CLI-mirrored
selftune-override tools.

Links & Resources

  • src/mcp/server.ts: loopover_clear_selftune_override (the remote tool this issue mirrors
    locally), loopover_get_selftune_override_audit
  • packages/loopover-mcp/bin/loopover-mcp.ts: loopover_get_selftune_override_audit's
    registerStdioTool block (the exact pattern to copy, swapping apiGet for apiDelete)
  • feat(mcp): add remote + stdio + CLI surfaces for the selftune override audit #7997 — added the CLI mirror for loopover_get_selftune_override_audit

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions