Skip to content

detectInstalledProviders truthy gate misclassifies subprocess slots as HTTP #174

Closed

Description

@jobordu

Context

bin/manage-agents-core.cjs:362:

```js
if (!p.cli || p.type === 'http') return true;
```

The intent is "HTTP-only slots are always included (no CLI to probe)". The implementation also returns true for any subprocess slot where p.cli is falsy — which is the default state after ensureMcpSlotsFromProviders reconstructs providers.json from ~/.claude.json mcpServers (those entries only set mainTool, not cli).

Consequence: subprocess slots with cli: null skip the binary-existence check entirely. They get included even when the underlying CLI isn't installed, producing UNAVAIL at dispatch time instead of being filtered out at startup with a clear "CLI not found" message.

Proposed solution

Replace the truthy check with an explicit type check:

```js
if (p.type === 'http') return true;
const binaryPath = p.resolvedCli || p.cli || p.mainTool;
if (!binaryPath) {
process.stderr.write([manage-agents-core] ${p.name} has no resolvable CLI (cli, resolvedCli, mainTool all empty) — excluded\n);
return false;
}
// ... existing accessSync probe ...
```

Combined with PR #161's mainTool fallback in resolveCli, this gives the function a consistent contract: every subprocess slot must have some resolvable binary or it gets excluded with a clear log line.

Acceptance criteria

  • HTTP slots always pass (current behavior preserved)
  • Subprocess slots with no resolvable binary excluded with a diagnostic
  • Subprocess slots with cli: null but valid mainTool correctly probed via mainTool
  • Existing tests still pass

Activity

  1. added a commit that references this issue on May 18, 2026
    b368205
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions