Skip to content

Killed or timed-out reviews should leave a discoverable session id and per-group state #2124

Backlog

Description

@cc7gs

Problem Statement

ocr review already has file-level checkpoints and --resume <session-id>. But when the process is killed by a task timeout, an external supervisor, or a caller-side script window, it leaves no parseable report, so the caller cannot discover the session id of the partially completed run. ocr session list shows sessions but no group/wave state, and the journal format is internal.

For callers running inside hard wall-clock windows (CI slices, platform reviewers budgeted at ~10 minutes), a killed run currently means redoing completed work: in aggregated private-repo measurements, a 35-file review that hit a 30-minute task limit had to redo model requests for files that were already reviewed on every retry.

Affected area: review run lifecycle / session persistence.

Proposed Solution

  • Persist a parseable receipt with the session id in a documented location when the process is killed or cancelled, so the caller can resume without guessing or scraping internal journals.
  • Surface group/wave state somewhere callers can read: groupId, files, state (done/failed/pending), completedFiles, missingFiles, failureCode.
  • Include groups[] with the same shape in the review JSON result, so coverage can be mapped to groups after the fact.
  • After an unclean kill, --resume <session-id> should reuse completed files without re-issuing model requests for them.

With --grouping (#2117) callers can soon control group sizes to fit a window, which makes post-kill recovery the remaining gap for large change sets.

Alternatives Considered

Polling ocr session list and reverse-engineering the session journal - fragile, loses group identity, and the journal is not a documented interface.

Additional Context

Split from #2113 so its grouping request can close with #2117. Related: #368 (typed retry of failed work), #2105 / #2087 / #1649 (existing resume behavior bugs - this request is about discovering state after an unclean kill, complementary to those fix requests).

Aggregated measurements only; no private code, repository names, or patches included.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions