gitbutlerapp/gitbutler · error

${textFromToolResult(result)}

Error message

${textFromToolResult(result)}

What it means

The polling refresh in the MCP review app rethrows the server tool's own error: the gitbutler_refresh_reviews tool returned a result flagged isError, and textFromToolResult extracts the embedded message. It means the backend refresh of the polled review numbers failed (e.g. GitHub API or auth problem), with the precise cause carried in the tool-result text.

Solutions

  1. Read the embedded tool-result text - it carries the backend's reason for the failed refresh
  2. Verify GitHub authentication and repository permissions for the review's repo
  3. Let the next polling tick retry the refresh; restart the app if errors persist
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at packages/but-mcp-app/src/ReviewApp.tsx:346 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gitbutlerapp/gitbutler@58e5313667 (2026-09-18). Data as JSON: /api/errors/6bc54955b50ce55a. Report an issue: GitHub.

Appendix: source

Thrown at packages/but-mcp-app/src/ReviewApp.tsx:346

			return;
		}

		const reviewNumbers = view.reviews.filter(shouldPollReview).map((review) => review.number);
		if (reviewNumbers.length === 0) return;

		let cancelled = false;

		async function refreshReviews() {
			try {
				const result = await app?.callServerTool({
					name: "gitbutler_refresh_reviews",
					arguments: {
						repository: view?.repository.path,
						reviewNumbers,
					},
				});
				if (cancelled || result === undefined) return;
				if (result.isError) throw new Error(textFromToolResult(result));
				const refreshed = reviewViewFromToolResult(result);
				if (refreshed === null) {
					throw new Error("The refreshed reviews were missing from the response.");
				}
				setView((current) => (current === null ? current : mergeReviewViews(current, refreshed)));
			} catch (pollCause) {
				if (cancelled) return;
				setPollingError(
					pollCause instanceof Error ? pollCause.message : "Could not refresh CI status.",
				);
			}
		}

		const timeout = window.setTimeout(() => void refreshReviews(), REVIEW_POLL_INTERVAL_MS);
		return () => {
			cancelled = true;
			window.clearTimeout(timeout);
		};

View on GitHub (pinned to 58e5313667)