deepseek-ai/deepseek-harness · error

model-discovery-failed

model-discovery-failed

Error message

error instanceof Error ? error.message : String(error)

What it means

Catch-and-wrap in the api-proxy discoverModels handler: the provider model discovery request threw (network, auth, or bad baseURL) and its message — via error instanceof Error ? error.message : String(error) — is returned as a structured err() response. Generic relay of the discovery failure.

Solutions

  1. Read the forwarded error message in the response or logs and fix the underlying failure it names.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/host/apiproxy/src/api-proxy.ts:3318 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/aa3179bf8af30338. Report an issue: GitHub.

Appendix: source

Thrown at packages/host/apiproxy/src/api-proxy.ts:3318

      },

      async discoverModels(request, signal) {
        const { settingsNs, provider, baseURL, api, apiKey } = request.payload
        try {
          const models = await ctx.llm.discoverModels(settingsNs, {
            ...provider === undefined ? {} : { provider },
            ...baseURL === undefined ? {} : { baseURL },
            ...api === undefined ? {} : { api },
            ...apiKey === undefined ? {} : { apiKey },
            ...signal === undefined ? {} : { signal },
          })
          return ok(request, { models })
        } catch (error: unknown) {
          // Every failure here is the user's next move, not a transport fault:
          // a wrong endpoint, a rejected key, or a protocol with no listing all
          // end at the same place — fill the models in by hand. The details
          // repeat only what the caller already sent, never the credential.
          return err(request, {
            code: 'model-discovery-failed',
            message: error instanceof Error ? error.message : String(error),
            details: { settingsNs, ...baseURL === undefined ? {} : { baseURL } },
          })
        }
      },
    },

    events: {
      mux(_request, signal) {
        const queue = new FrameQueue<RpcRequest<MuxFrame>>()
        muxQueues.add(queue)
        for (const session of ctx.sessions.list()) {
          subscribeSession(queue, session)
        }
        for (const pending of pendingQuestions.values()) {
          queue.push({
            rpcId: pending.rpcId,

View on GitHub (pinned to b150a551b8)