alibaba/open-code-review · error

resume session %q was interrupted before it closed, so it ne

Error message

resume session %q was interrupted before it closed, so it never recorded a run manifest and its input identity cannot be verified; %s

What it means

validateInputIdentity refuses to resume a session that has no run manifest and was not closed cleanly. An interrupted session never froze its input identity, so there is nothing verifiable to resume against — resuming could silently mismatch the original input. The recommended action is to start a new review.

Source

Thrown at internal/session/resume_identity.go:89

// validateInputIdentity compares only the input half of the resume contract: the
// parent manifest must be verifiable, and every input field must match. Provider
// and model are deliberately left out: those are command-line intent, not
// something derived from the input.
//
// This runs once, at admission, and is never repeated during the run: the caller
// pins the run to the commit endpoints this comparison was made against (see
// agent.SealedInput), so a second comparison could only ever confirm the first.
func (s *ResumeState) validateInputIdentity(id RunIdentity) error {
	if s == nil {
		return nil
	}

	m := s.Manifest
	switch {
	case m == nil && !s.Closed:
		// Distinguishing all of these from "manifest present, zero completed
		// items" is the whole point: that one is resumable, none of these are.
		return fmt.Errorf("resume session %q was interrupted before it closed, so it never recorded a run manifest and its input identity cannot be verified; %s", s.SessionID, resumeHint)
	case m == nil:
		// It closed cleanly, so blaming an interruption would send the user
		// looking for a crash that never happened. A session_end with no manifest
		// is a session older than run manifests, or a run that failed before
		// freezing one.
		return fmt.Errorf("resume session %q closed without a run manifest, so its input identity cannot be verified — it either predates run manifests or failed before recording one; %s", s.SessionID, resumeHint)
	case m.SchemaVersion != ManifestSchemaVersion:
		return fmt.Errorf("resume session %q carries manifest schema %q, but this build can only verify %q; %s", s.SessionID, m.SchemaVersion, ManifestSchemaVersion, resumeHint)
	case m.Operation != OperationReview:
		return fmt.Errorf("resume session %q recorded operation %q, not %q; %s", s.SessionID, m.Operation, OperationReview, resumeHint)
	case len(m.Coverage.Selected) == 0:
		// Without this, an empty parent and an empty child would both hash to the
		// canonical empty digest, pass every comparison, and produce a run that
		// reuses nothing and dispatches nothing.
		return fmt.Errorf("resume session %q selected no input, so it has nothing to resume; %s", s.SessionID, resumeHint)
	}

	if m.Input.Mode != id.Mode {

View on GitHub (pinned to 5cf97d0d15)

Solutions

  1. Start a new review instead of resuming (the hint appended to the error)
  2. Delete or ignore the stale interrupted session and re-run the review from scratch
  3. If crashes recur, fix the underlying interruption cause (timeout, OOM) before retrying
Defensive patterns

Strategy: validation

Validate before calling

// Refuse to resume sessions that never completed a run
if sess.Manifest == nil && !sess.Closed {
    return fmt.Errorf("session %s was interrupted; start a new review instead", sess.SessionID)
}

Type guard

func resumableSession(s *session.State) bool {
    return s != nil && s.Closed && s.Manifest != nil
}

Try / catch

if err := ValidateResume(s, req); err != nil {
    if strings.Contains(err.Error(), "interrupted before it closed") {
        return startNewReview(req) // fall back to a fresh run
    }
    return err
}

Prevention

When it happens

Trigger: Calling ValidateResume on a session where s.Manifest == nil and s.Closed == false — the process was killed/crashed between session start and session_end, before a manifest was persisted.

Common situations: Terminal or CI job killed mid-run (SIGKILL, OOM, timeout); power loss or crash during the first review run; the session was created but the run failed before the manifest freeze step.

Related errors


AI-assisted analysis of alibaba/open-code-review@5cf97d0d15 (2026-09-02). Data as JSON: /api/errors/670f0955fab0f42f. Report an issue: GitHub.