Skip to content

Registry nodes named "default" or "all" are silently shadowed #161

Closed

Description

@TMHSDigital

Summary

HOMELAB_NODES accepts the keys default and all, but both names are reserved elsewhere, which makes such nodes behave inconsistently.

Where

  • mcp-server/src/utils/ssh-api.ts:148-195 (getNodesRegistry, getNodeConfig, listNodes)
  • mcp-server/src/utils/fan-out.ts:160, :174-176
  • mcp-server/src/tools/nodeList.ts:28-29

Details

listNodes always adds the env default as default and then appends registry entries, so a registry default is listed twice. getNodeConfig("default") returns the registry entry, but fan-out and nodeList map default to undefined (the env host). A registry all can never be targeted by read-only fan-out tools, because all is the fan-out keyword.

Impact

With a registry default, node: "all" and nodeList probe the env host twice and can show a down node as online; node: "default" and an omitted node reach different machines.

Steps to reproduce

  1. HOMELAB_PI_HOST=a.local, HOMELAB_NODES={"default":{"host":"b.local"}}
  2. homelab_nodeList prints default (a.local) and default (b.local), both probed on a.local

Suggested fix

Reject default and all in getNodesRegistry with an error naming the reserved word, and add a unit test.

Acceptance criteria

  • Reserved names produce a clear configuration error
  • Unit test added

Getting started

  • Relevant files: mcp-server/src/utils/ssh-api.ts, mcp-server/src/utils/fan-out.ts
  • How to run tests: cd mcp-server && npm install && npm test (and npm run typecheck); structure tests: pip install -r requirements-test.txt && pytest tests/ -v
  • Conventions: see CLAUDE.md and CONTRIBUTING.md

Filed by repo-audit/full-audit at 636fefb. Severity: low. Effort: S. audit-key: bug|mcp-server/src/utils/ssh-api.ts|getNodesRegistry

Activity

  1. added
    bug
    good first issue
    severity: low
    on Nov 18, 2026
  2. TMHSDigital commented on Nov 19, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in 9fb4dd5: getNodesRegistry rejects entries named default or all with an error naming the reserved word; getNodeConfig resolves default to the HOMELAB_PI_* node first. Verified with unit tests for both names; build, typecheck, Vitest and structure tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issueseverity: low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions