different-ai/openwork · error · Error

GitHub install completion response was incomplete.

Error message

GitHub install completion response was incomplete.

What it means

useGithubInstallCompletion exchanges the GitHub installation callback for a connector account record. After the server responds, the payload's items are scanned for a connectorAccount; if none is found or its id/displayName fields are missing/empty, this error is thrown because the completed install cannot be mapped to a local account.

Source

Thrown at ee/apps/den-web/app/(den)/dashboard/_components/integration-data.tsx:509

                  : manifestKind === "plugin"
                    ? "Claude plugin manifest detected."
                    : "Repository available to connect.",
                fullName,
                hasPluginManifest: Boolean(entry.hasPluginManifest),
                hasPlugins: Boolean(entry.hasPluginManifest),
                id,
                manifestKind,
                marketplacePluginCount: typeof entry.marketplacePluginCount === "number" ? entry.marketplacePluginCount : null,
                name: toRepoName(fullName),
                private: Boolean(entry.private),
              } satisfies IntegrationRepo];
            })
          : [];

        const connectorAccountId = connectorAccount ? asString(connectorAccount.id) : null;
        const connectorAccountName = connectorAccount ? asString(connectorAccount.displayName) : null;
        if (!connectorAccount || !connectorAccountId || !connectorAccountName) {
          throw new Error("GitHub install completion response was incomplete.");
        }

        result = {
          connectorAccount: {
            displayName: connectorAccountName,
            id: connectorAccountId,
            metadata: isRecord(connectorAccount.metadata) ? connectorAccount.metadata : undefined,
          },
          repositories,
        };
      });
      if (!result) {
        throw new Error("GitHub install completion response was incomplete.");
      }
      return result;
    },
  });
}

View on GitHub (pinned to 2b7df46e8a)

Solutions

  1. Wait a few seconds and retry — the connector account is often created asynchronously via webhook after the GitHub redirect.
  2. Check the server received the GitHub installation webhook (GitHub App webhook settings / delivery logs).
  3. Inspect the completion response body to see which of id/displayName is missing.
  4. If persistently missing, verify the GitHub App's webhook URL and secret on the Den server.

Example fix

// before
if (!connectorAccount || !connectorAccountId || !connectorAccountName) {
  throw new Error("GitHub install completion response was incomplete.");
}
// after
if (!connectorAccount || !connectorAccountId || !connectorAccountName) {
  await new Promise((r) => setTimeout(r, 2000));
  // refetch completion payload once before giving up
}
if (!connectorAccount || !connectorAccountId || !connectorAccountName) {
  throw new Error("GitHub install completion response was incomplete.");
}
Defensive patterns

Strategy: retry

Validate before calling

const body = await res.json();
const items = Array.isArray(body?.items) ? body.items : [];
if (items.length === 0) {
  // connector account may not exist yet — schedule a delayed refetch
}

Type guard

function hasConnectorAccount(p: unknown): p is { items: Array<{ connectorAccount: { id: string; displayName: string } }> } {
  if (typeof p !== "object" || p === null) return false;
  const items = (p as { items?: unknown }).items;
  if (!Array.isArray(items)) return false;
  return items.some((i) => {
    const ca = (i as { connectorAccount?: unknown }).connectorAccount;
    return (
      typeof ca === "object" && ca !== null &&
      typeof (ca as { id?: unknown }).id === "string" &&
      typeof (ca as { displayName?: unknown }).displayName === "string"
    );
  });
}

Try / catch

try {
  const completion = await completionQuery;
} catch (e) {
  if (e instanceof Error && e.message.includes("incomplete")) {
    await delay(2000);
    return completionQuery.refetch(); // webhook may not have landed yet
  }
  throw e;
}

Prevention

When it happens

Trigger: The completion endpoint returns 200 without a connectorAccount item (installation webhook not yet processed server-side), connectorAccount lacks id or displayName, or the response schema changed.

Common situations: User completed GitHub install but the server-side webhook that creates the connector account has not fired yet (race condition); GitHub webhook delivery failed; API version drift.

Related errors


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