Skip to content

src/mcp/server.ts imports 3 unused identifiers from settings/autonomy #8339

Description

@JSONbored

Context

src/mcp/server.ts:175 imports four names from ../settings/autonomy:

import { AGENT_ACTION_CLASSES, AUTONOMY_LEVELS, isActingAutonomyLevel, resolveAutonomy } from "../settings/autonomy";

Only AUTONOMY_LEVELS is actually used elsewhere in the file (e.g. z.enum(AUTONOMY_LEVELS) in the
setActionAutonomyShape tool-input schema). AGENT_ACTION_CLASSES, isActingAutonomyLevel, and
resolveAutonomy appear nowhere else in src/mcp/server.ts — confirmed by an exact-identifier grep
returning only the import line itself for each of the three names, with no re-export.

This slips past both static-analysis layers that would normally catch it: src/** has no ESLint
config (only apps/loopover-miner-ui and apps/loopover-ui have eslint.config.js), and the root
tsconfig.json doesn't set noUnusedLocals/noUnusedParameters.

Note: MAINTAIN_AUTONOMY_ACTION_CLASSES (src/mcp/server.ts:623, a separate 6-item local subset) is
not related to this cleanup and must not be touched — it's an intentional, already-documented
divergence from AGENT_ACTION_CLASSES (see the comment in
packages/loopover-mcp/bin/loopover-mcp.ts:149-152: "do not sync it to the engine list").

Requirements

  • Remove AGENT_ACTION_CLASSES, isActingAutonomyLevel, and resolveAutonomy from the import at
    src/mcp/server.ts:175, keeping only AUTONOMY_LEVELS.
  • Do not remove or modify anything in packages/loopover-engine/src/settings/autonomy.ts itself —
    these exports are used elsewhere in the codebase (e.g. by packages/loopover-mcp/bin/loopover-mcp.ts)
    and must stay exported as-is.
  • Do not touch MAINTAIN_AUTONOMY_ACTION_CLASSES at src/mcp/server.ts:623 — it is unrelated and
    intentional.
  • Confirm with a full-file rebuild/typecheck that no other reference to the three removed names exists
    anywhere in src/mcp/server.ts after the edit.

Deliverables

  • src/mcp/server.ts:175's import trimmed to only AUTONOMY_LEVELS.
  • npx tsc --noEmit (or the repo's standard typecheck script) passes clean on the changed file.

Test Coverage Requirements

Pure dead-import removal with no behavioral change — no new test is required. Existing tests covering
src/mcp/server.ts's tool handlers (which exercise AUTONOMY_LEVELS-dependent code paths, e.g.
setActionAutonomyShape) must continue passing unmodified as the regression check that nothing else
depended on the removed names.

Expected Outcome

src/mcp/server.ts no longer imports three unused identifiers from ../settings/autonomy. No
behavior changes; the file's existing test suite passes unmodified.

Links & Resources

  • src/mcp/server.ts:175 — the import to trim
  • packages/loopover-engine/src/settings/autonomy.ts — source module (not to be modified)
  • packages/loopover-mcp/bin/loopover-mcp.ts:149-152 — the comment explaining why
    MAINTAIN_AUTONOMY_ACTION_CLASSES intentionally diverges (context only, not in scope for this fix)

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