gitbutlerapp/gitbutler · warning · Error
The refreshed reviews were missing from the response.
Error message
The refreshed reviews were missing from the response.
What it means
Thrown inside the 30-second review-refresh poll in packages/but-mcp-app/src/ReviewApp.tsx:349. The gitbutler_refresh_reviews tool call returned without isError, but reviewViewFromToolResult returned null — the result's structuredContent is not an object carrying repository, forge, and reviews keys. The local catch converts it to a polling-error banner; the next interval retries automatically.
Source
Thrown at packages/but-mcp-app/src/ReviewApp.tsx:349
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);
};
}, [app, pollingError, view]);
if (error !== null) {View on GitHub (pinned to 2497b8007a)
Solutions
- Update the but CLI/desktop component so the tool emits the expected structuredContent
- Log result.structuredContent once to see exactly which key is missing
- Ship tool and UI in lockstep — bump both together in the same release
- If the keys were legitimately renamed, update reviewViewFromToolResult to the new schema
Example fix
// before
const refreshed = reviewViewFromToolResult(result);
if (refreshed === null) {
throw new Error("The refreshed reviews were missing from the response.");
}
// after — name the missing keys to make the mismatch diagnosable
const refreshed = reviewViewFromToolResult(result);
if (refreshed === null) {
const keys = result.structuredContent ? Object.keys(result.structuredContent).join(", ") : "none";
throw new Error(`The refreshed reviews were missing from the response (structuredContent keys: ${keys}).`);
} Defensive patterns
Strategy: type-guard
Type guard
function isReviewView(v: unknown): v is ReviewView {
return (
typeof v === "object" &&
v !== null &&
"repository" in v &&
"forge" in v &&
"reviews" in v
);
} Try / catch
// the poll already contains the right shape: keep failures non-fatal and let the next tick retry
try {
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.");
} Prevention
- Ship the MCP tool and the app UI in the same release so schemas stay aligned
- Log structuredContent shape once on mismatch to identify the missing key
- Treat poll failures as transient — the 30s interval retries automatically
- Never let a poll error unmount the view; keep last-good data rendered
When it happens
Trigger: Calling gitbutler_refresh_reviews with {repository, reviewNumbers} where the tool version returns text-only content or a changed schema (structuredContent missing repository/forge/reviews); version skew between the but-mcp-app bundle and the server tool.
Common situations: Desktop app or but CLI updated independently of the MCP app; an MCP host that strips or rewrites structuredContent; schema evolution of the review payload between releases.
Related errors
- The updated review was missing from the response.
- textFromToolResult(result)
- The detail result was missing structured data.
- Invalid message format
- Invalid token format
AI-assisted analysis of gitbutlerapp/gitbutler@2497b8007a (2026-08-17).
Data as JSON: /api/errors/45bc997c24021bae.
Report an issue: GitHub.