gitbutlerapp/gitbutler · error
is not open and cannot be marked ready
Error message
{}{} is not open and cannot be marked ready What it means
prepare_mark_review_ready fetches the review from the forge and only draft reviews that are still open can be marked ready. If the review is already closed/merged, the operation is rejected with the review's unit symbol and number. This guards the state machine — a non-open review cannot transition to 'ready'.
Solutions
- Use a review number that is still open; list open reviews first to pick a valid one
- If the review is already merged/closed, no action is needed — skip marking it ready
- Refresh your cached review state before retrying
Defensive patterns
Strategy: validation
Validate before calling
const open = await callTool('review_view', { repository, review_numbers: [n] });
if (open.status !== 'open' || open.draft !== true) throw new Error(`review ${n} is not an open draft`); Try / catch
try { await callTool('mark_review_ready', req); } catch (e) { if (/is not open and cannot be marked ready/.test(e.message)) skipAlreadyFinished(e); } Prevention
- Refresh review state before ready-marking
- Filter candidate reviews to open drafts first
- Treat merged/closed reviews as no-op in automation
When it happens
Trigger: Calling mark-review-ready with a review_number whose review is not open (already merged, closed, or otherwise finished).
Common situations: Stale review numbers after a PR was merged; automations retrying ready-marking after completion; concurrent actions where another user closed the review first.
Understand the failure class
Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.
Related errors
- Marking reviews ready is not supported for
- At least one review number is required
- Azure is unsupported at the minute. Sorry 😞.
- Branch ` ` is not part of the current workspace
- Branch ` ` is pushed, but its remote ancestry does not…
AI-assisted analysis of gitbutlerapp/gitbutler@58e5313667 (2026-09-18).
Data as JSON: /api/errors/21e543bc2ab4e1c9.
Report an issue: GitHub.
Appendix: source
Thrown at crates/but/src/command/mcp/mod.rs:790
review_view(&request.repository, &[request.review_number])
}
enum MarkReadyPreparation {
AlreadyReady(ReviewView),
Update {
preferred_user: Option<but_forge::ForgeUser>,
repository: but_forge::ForgeRepoInfo,
storage: but_forge_storage::Controller,
},
}
fn prepare_mark_review_ready(request: &MarkReviewReadyRequest) -> Result<MarkReadyPreparation> {
let resolved = open_repository(&request.repository)?;
let forge = ForgeRepository::from_context(&resolved.ctx)?;
let review = forge.get_review(&resolved.ctx, request.review_number)?;
if !review.is_open() {
bail!(
"{}{} is not open and cannot be marked ready",
review.unit_symbol,
review.number
);
}
if !review.draft {
return review_view_from_repository(resolved, &[request.review_number])
.map(MarkReadyPreparation::AlreadyReady);
}
if !forge.display.capabilities.pr_service {
bail!(
"Marking reviews ready is not supported for {:?}",
forge.display.name
);
}
let ForgeRepository {
preferred_user,View on GitHub (pinned to 58e5313667)