gitbutlerapp/gitbutler · warning · Error
textFromToolResult(result)
Error message
textFromToolResult(result)
What it means
The MCP tool call gitbutler_refresh_reviews returned a result with isError=true, and the thrown message is textFromToolResult(result) — the error text the tool/server produced. The logged 'message' is the helper expression itself; the user actually sees the server's diagnostic string.
Solutions
- Confirm view?.repository.path still exists on the machine running the MCP server.
- Reload/reopen the reviews view so fresh review numbers are passed instead of stale ones.
- Read the full tool-result text (setPollingError shows it) — it carries the server's underlying git error.
- Restart the MCP host if the server-side git state is wedged (stale locks, dead credential helper).
Defensive patterns
Strategy: try-catch
Validate before calling
if (!view?.repository.path) {
setPollingError("Repository path is unknown — reload the view.");
return;
} Try / catch
try {
const result = await app?.callServerTool({ name: "gitbutler_refresh_reviews", arguments: { repository: view?.repository.path, reviewNumbers } });
if (result?.isError) throw new Error(textFromToolResult(result));
} catch (pollCause) {
if (cancelled) return;
setPollingError(pollCause instanceof Error ? pollCause.message : "Could not refresh CI status.");
} Prevention
- Validate the repository path exists before scheduling the poll.
- Stop the poll loop after consecutive failures instead of hammering a broken repo path.
- Surf the full tool-result text — it contains the server's git error.
When it happens
Trigger: Calling gitbutler_refresh_reviews with a repository path the server cannot open, reviewNumbers that no longer exist, or a backend git failure while recomputing CI/review state; the periodic poll in ReviewApp hits it every REVIEW_POLL_INTERVAL_MS until it clears.
Common situations: The repository was moved/deleted after the view loaded; reviews were closed remotely so the numbers are stale; the MCP server's git invocation fails (auth, lock, corruption).
Related errors
- textFromToolResult(result)
- ${textFromToolResult(result)}
- a committed transaction always materializes a workspace
- Ambiguous branch ' ', matches multiple items
- Ambiguous branch ' ', matches multiple items
AI-assisted analysis of gitbutlerapp/gitbutler@caf1f223d3 (2026-08-20).
Data as JSON: /api/errors/fc9e64d707e64cc7.
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 caf1f223d3)