gitbutlerapp/gitbutler · error

The updated review was missing from the response.

Error message

The updated review was missing from the response.

What it means

Thrown at ReviewApp.tsx:404 after gitbutler_mark_review_ready returned success (no isError) and reviewViewFromToolResult accepted the structuredContent, but the reviews array is missing or empty (updatedView?.reviews[0] is undefined). The tool acknowledged success without echoing the updated review, so the UI has nothing to merge and reports the error via setActionError.

Source

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

	const connectedApp = app;
	const currentView = view;
	const canCallTools = connectedApp.getHostCapabilities()?.serverTools !== undefined;

	async function markReady(review: ReviewCardData) {
		setPendingReview(review.number);
		setActionError(null);
		try {
			const result = await connectedApp.callServerTool({
				name: "gitbutler_mark_review_ready",
				arguments: {
					repository: currentView.repository.path,
					reviewNumber: review.number,
				},
			});
			if (result.isError) throw new Error(textFromToolResult(result));
			const updatedView = reviewViewFromToolResult(result);
			const updatedReview = updatedView?.reviews[0];
			if (!updatedReview) throw new Error("The updated review was missing from the response.");
			setView((current) =>
				current === null || updatedView === null ? current : mergeReviewViews(current, updatedView),
			);
		} catch (actionCause) {
			setActionError(
				actionCause instanceof Error ? actionCause.message : "Could not mark the review ready.",
			);
		} finally {
			setPendingReview(null);
		}
	}

	async function openReview(review: ReviewCardData) {
		setActionError(null);
		try {
			await connectedApp.openLink({ url: review.url });
		} catch (actionCause) {
			setActionError(

View on GitHub (pinned to 2497b8007a)

Solutions

  1. Update the but CLI/desktop so mark_ready echoes the updated review in structuredContent.reviews
  2. Refresh the full review list after a successful mark-ready instead of relying on the echo
  3. Check whether a UI filter explains the empty array before treating it as a failure

Example fix

// before
const updatedReview = updatedView?.reviews[0];
if (!updatedReview) throw new Error("The updated review was missing from the response.");

// after — fall back to a full list refresh when the echo is absent
if (updatedView?.reviews[0]) {
	setView((current) => (current === null ? current : mergeReviewViews(current, updatedView)));
} else {
	await refreshReviewList(); // success without echo: resync from the source
}
Defensive patterns

Strategy: type-guard

Type guard

function hasUpdatedReview(v: ReviewView | null): v is ReviewView & { reviews: [ReviewCardData, ...ReviewCardData[]] } {
	return Array.isArray(v?.reviews) && v.reviews.length > 0;
}

Try / catch

const updatedView = reviewViewFromToolResult(result);
if (hasUpdatedReview(updatedView)) {
	setView((current) => (current === null ? current : mergeReviewViews(current, updatedView)));
} else {
	// success without an echo: resync from a full list refresh instead of erroring
	await refreshReviewList();
}

Prevention

When it happens

Trigger: The tool's success payload carries an empty reviews array or a renamed field; version skew where mark_ready returns a bare {ok:true} without the review echo; the updated review legitimately fell outside a UI filter (e.g. it left the draft scope after becoming ready).

Common situations: UI filtering drafts: marking ready removes the review from the filtered result set; tool/UI version mismatch after a partial upgrade.

Related errors


AI-assisted analysis of gitbutlerapp/gitbutler@2497b8007a (2026-08-17). Data as JSON: /api/errors/aa9b4a5690b88639. Report an issue: GitHub.