Skip to content

resolveProvider never dispatches the typesafe provider (v0.1.0) #2

Description

@darenlam

What happened?

resolveProvider() in src/route.mjs imports TypeSafeProvider but has no branch
that returns it, so every request configured for the documented typesafe
provider falls through to the final throw. Both the CLI and the stdio MCP
server are affected, because src/mcp-server.mjs routes through the same
routeRequest().

jev doctor reports the configuration as healthy (provider: ok,
secret:TYPESAFE_API_KEY: ok), which makes this look like a working setup right
up until the first real decision.

Observed:

{"status":"error","reason":"unsupported provider: typesafe","execution":{"enabled":false,"status":"not_started"}}

Expected behavior

provider: "typesafe" resolves to the already-implemented TypeSafeProvider
from src/providers/typesafe.mjs and returns a normal decision envelope, as
documented in docs/PROVIDERS.md (which lists typesafe as one of the three
supported providers with endpoint https://api.typesafe.ai/v1/systemone and
default model jev-latest).

Reproduction

  • Node.js version: 26.0.0
  • jev-layer version/commit: 0.1.0 (npm, published 2026-09-19)
  • Harness: OMP (also reproduces via the bare CLI, no harness needed)
  • Provider (name only; never include credentials): typesafe
  • Command or fixture:
npm install --global jev-layer
export TYPESAFE_API_KEY=<redacted>
jev init --project /tmp/jevtest --provider typesafe
jev doctor --project /tmp/jevtest          # all checks ok, including the secret
jev cli --provider typesafe --input examples/route-request.json
# => {"status":"error","reason":"unsupported provider: typesafe", ...}

jev cli --provider demo --input examples/route-request.json
# => works, status "selected"

Logs or receipts

src/route.mjs, line 6 imports the class:

import { OpenRouterDecisionsProvider, TypeSafeProvider } from "./providers/typesafe.mjs";

…and resolveProvider() never uses it:

function resolveProvider(provider, options) {
  if (provider && typeof provider === "object" && typeof provider.decide === "function") return provider;
  if (provider === "demo") return new DemoProvider();
  if (provider === "openrouter") return new OpenRouterDecisionsProvider(options.openrouter);
  throw new Error(`unsupported provider: ${provider}`);
}

Suggested one-line fix, matching the openrouter branch and the existing
constructor signature ({ apiKey, endpoint, model, timeoutMs }, all defaulted
from process.env):

  if (provider === "typesafe") return new TypeSafeProvider(options.typesafe);

Applied locally against 0.1.0 and verified: the same examples/route-request.json
then returns status: "selected", selected: "repo_search", with file_write
correctly filtered as actor lacks required capability permissions.

Two smaller notes from the same session, if useful:

  1. jev doctor passes a typesafe configuration that cannot possibly route.
    Checking that the selected provider actually resolves would have caught this
    without an API call.
  2. CHANGELOG.md for 0.1.0 states "This version is prepared but has not been
    pushed, released on GitHub, or published to npm", which is confusing next to
    the published npm package and public repo. Worth a line edit.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions