different-ai/openwork · error · Error

Inference settings response was incomplete.

Error message

Inference settings response was incomplete.

What it means

loadStatus fetches GET /v1/inference and runs parseInferencePayload on the JSON body. When the response is HTTP 200 but the payload is missing or has malformed fields required to build an InferenceStatus, the parser returns null and this error is thrown. It indicates a server-side contract violation rather than a network or auth failure.

Source

Thrown at ee/apps/den-web/app/(den)/dashboard/_components/inference-screen.tsx:326

  const isSelfHosted = runtimeConfigLoaded && runtimeConfig.orgMode === "single_org";
  const activeOrgSlug = activeOrg?.slug ?? null;

  useEffect(() => {
    if (!isSelfHosted) return;
    router.replace(getCustomLlmProvidersRoute(activeOrgSlug));
  }, [isSelfHosted, activeOrgSlug, router]);

  async function loadStatus() {
    setLoading(true);
    setError(null);
    try {
      const { response, payload } = await requestJson("/v1/inference", { method: "GET" }, 12000);
      if (!response.ok) {
        throw new Error(getErrorMessage(payload, `Failed to load inference settings (${response.status}).`));
      }
      const parsed = parseInferencePayload(payload);
      if (!parsed) {
        throw new Error("Inference settings response was incomplete.");
      }
      setStatus(parsed);
    } catch (loadError) {
      setError(loadError instanceof Error ? loadError.message : "Failed to load inference settings.");
    } finally {
      setLoading(false);
    }
  }

  useEffect(() => {
    void loadStatus();
  }, [orgContext?.organization.id]);

  // Subscribe at the point of value: start the Stripe checkout right here
  // instead of bouncing the user to the billing page. Billing stays the
  // status/portal view.
  async function startSubscribeCheckout() {
    if (!canManageModels) {

View on GitHub (pinned to 2b7df46e8a)

Solutions

  1. Check the server version serving /v1/inference and upgrade so it matches the dashboard's expected InferenceStatus contract.
  2. Log the raw payload from /v1/inference (curl with auth cookie) to see which required field is missing or null.
  3. Bypass or fix any proxy that could return non-JSON 200 bodies for this endpoint.
  4. Retry after a transient deploy; if persistent, file a backend bug with the raw response.

Example fix

// before
const parsed = parseInferencePayload(payload);
if (!parsed) throw new Error("Inference settings response was incomplete.");
// after
const parsed = parseInferencePayload(payload);
if (!parsed) throw new Error(`Inference settings response was incomplete: ${JSON.stringify(payload).slice(0, 200)}`);
Defensive patterns

Strategy: type-guard

Validate before calling

const res = await fetch("/v1/inference", { credentials: "include" });
const body = await res.json();
const parseable = typeof body === "object" && body !== null && "enabled" in body;

Type guard

function isInferencePayload(p: unknown): p is Record<string, unknown> {
  return typeof p === "object" && p !== null && "enabled" in p && "organization" in p;
}

Try / catch

try {
  const { response, payload } = await requestJson("/v1/inference", { method: "GET" }, 12000);
  if (!response.ok) throw new Error(getErrorMessage(payload, `Failed to load inference settings (${response.status}).`));
  const parsed = parseInferencePayload(payload);
  if (!parsed) throw new Error("Inference settings response was incomplete.");
} catch (e) {
  setError(e instanceof Error ? e.message : "Failed to load inference settings.");
}

Prevention

When it happens

Trigger: GET /v1/inference returns 200 with a body that parseInferencePayload rejects: missing required fields (e.g. enabled/subscription/model data), an HTML or empty body instead of JSON, or an API version that changed the response shape.

Common situations: Server deployed at a different version than the dashboard frontend (API contract drift); a proxy/gateway returning an HTML error page with 200; self-hosted server with an older /v1/inference implementation.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01). Data as JSON: /api/errors/0f16739e0ba26647. Report an issue: GitHub.