tinyhumansai/openhuman · error

Failed to list branches

Error message

Failed to list branches

What it means

BranchPicker calls Composio's GITHUB_LIST_BRANCHES for the chosen owner/repo (per_page 100); a successful=false response with an empty error string falls back to this message. The GitHub connection is not re-verified here — the repo was already selected upstream.

Source

Thrown at app/src/components/skills/inputs/BranchPicker.tsx:72

      setError(null);
      return;
    }
    const [owner, repoName] = repo.split('/');
    if (!owner || !repoName) {
      setBranches([]);
      return;
    }
    const seq = ++requestSeqRef.current;
    setLoading(true);
    setError(null);
    try {
      const res = await composioExecute('GITHUB_LIST_BRANCHES', {
        owner,
        repo: repoName,
        per_page: 100,
      });
      if (seq !== requestSeqRef.current) return;
      if (!res.successful) throw new Error(res.error ?? 'Failed to list branches');
      // Composio wraps GitHub branch data in a few different shapes
      // (details, data.details, branches, items, direct array under data) —
      // probe the same way DevWorkflowPanel does.
      const raw = res.data;
      let list: GhBranch[] = [];
      if (Array.isArray(raw)) {
        list = raw as GhBranch[];
      } else if (raw && typeof raw === 'object') {
        const obj = raw as Record<string, unknown>;
        const dataObj = obj.data as Record<string, unknown> | undefined;
        const arr =
          (obj.details as unknown[] | undefined) ??
          (dataObj?.details as unknown[] | undefined) ??
          (obj.branches as unknown[] | undefined) ??
          (obj.items as unknown[] | undefined) ??
          (dataObj as unknown[] | undefined);
        if (Array.isArray(arr)) {
          list = arr as GhBranch[];

View on GitHub (pinned to a221052e0d)

Solutions

  1. Confirm the repo still exists and the connected account can see it, then retry
  2. Reconnect GitHub via Composio if the token lost repo scope
  3. Re-pick the repository (or retry later) if listing keeps failing
Defensive patterns

Strategy: try-catch

Validate before calling

// Guard the inputs before the Composio call:
if (!owner.trim() || !repoName.trim() || /\s/.test(`${owner}${repoName}`)) {
  // block fetch: malformed owner/repo always fails the action
}

Type guard

const isBranchListResult = (raw: unknown): boolean =>
  Array.isArray(raw) || !!((raw as Record<string, unknown>)?.details);

Try / catch

try {
  const res = await composioExecute('GITHUB_LIST_BRANCHES', { owner, repo, per_page: 100 });
  if (!res.successful) { setError(res.error ?? 'Failed to list branches'); return; }
} catch (e) {
  // network/Composio-level failure: offer retry and reconnect-GitHub hint
}

Prevention

When it happens

Trigger: Composio action fails with res.error empty: token lost access to the repo, repo renamed/deleted/made private, GitHub rate limit.

Common situations: Repo transferred or privated after the connection was made; GitHub App scopes narrowed; bursts of branch listing hitting rate limits.

Related errors


AI-assisted analysis of tinyhumansai/openhuman@a221052e0d (2026-08-16). Data as JSON: /api/errors/4544b526f0e561bf. Report an issue: GitHub.