Skip to content

Ultrafix: start with fix when /ultrafix carries instructions, and show they were applied #3802

Backlog

Description

@integry

Problem

/ultrafix <instructions> (and MCP run_ultrafix / start_ultrafix with instructions) is the natural way to give the loop maintainer findings, for example from an independent review on another model. Two things make that unreliable in practice:

  1. The loop always opens with a fresh /review, even when the instructions are the review. initialAction is fix only when an unprocessed ProPR review is pending (packages/core/src/webhook/commentEventHandler.ts, around line 530: initialAction = startWithPendingReview ? 'fix' : 'review'). The instructions go to that review as instructions, and the loop then fixes the new review's F# blockers. That costs a review cycle, and the score can drop ([3798 by GPT-6.2 Astra] FlyMachinesRuntime (restart, Astra): ephemeral Fly Machine per run, one authoritative output path #3801 went 7 → 5 on a review of the unchanged head).
  2. You can't see whether the instructions reached the fix step. In code they do: enqueueNextStep passes ultrafixMeta.instructions as commandInstructions, and reviewFindingSelector keeps them for ultrafix. But the "Ultrafix loop started" comment, the fix handoff and the "Applied the requested follow-up changes" summary don't mention them. On [3799 by GPT-6.2 Astra] Sprites runner pool (restart, Astra): shared cap, conservative orphan cleanup, ambiguous restart #3800 the first fix commit covered the maintainer blockers, but you can't tell whether that came from the instructions or from the new review. So the practical workaround is to post findings as a separate regular comment and start ultrafix bare.

Proposed

  • When /ultrafix has non-empty instructions, start with fix and treat the instructions as the blocker list for the first fix step, with or without a pending review. Then review as usual. Optionally add a flag (first=review|fix) to override.
  • Show the instructions on screen: quote a short excerpt (or a hash plus the first lines) in the "Ultrafix loop started" comment, and in each fix handoff's summary add a "Maintainer instructions addressed" section that maps each instruction item to done, skipped or declined, with a reason.
  • Have the fix agent's report cover numbered instruction items explicitly, the same way it covers F# records, so a skipped item is visible.
  • MCP: run_ultrafix returns firstAction and whether instructions were attached.

Acceptance

  • /ultrafix goal=8 max=5\n1. fix A\n2. fix B on a PR with no pending review enqueues a fix step first, and its prompt contains items 1–2.
  • The loop-started comment and the first fix summary both show the instructions, and the summary lists the status of each item.
  • Without instructions, behaviour is unchanged: review first unless a review is pending.
  • Tests in the existing ultrafix startup and continuation suites.

Found while working on runtime epic PRs #3800 and #3801.

Activity

  1. integry commented on Nov 25, 2026

    @integry
    OwnerAuthor

    Addendum: start from unaddressed review findings too

    Ultrafix should start the way a bare /fix would: if any review findings have not been addressed since the last /fix (or the last ultrafix fix step), the first step is fix, using those findings plus any instructions. Only when nothing is outstanding should it start with a review.

    What the code does now:

    • getPendingReviewState (src/jobs/reviewCommentGatherer.ts) already sets hasPendingReview when an unprocessed review has actionable findings. But startWithPendingReview = !olderPrWorkExists && hasPendingReview (commentEventHandler.ts around line 530) falls back to review whenever any older or in-flight PR work exists (hasAutomaticWork, existingJob, checkExistingJob). For example, a /review requested a few minutes earlier, or a just-finished ultrafix loop, makes the next /ultrafix discard the outstanding findings and review again. On [3798 by GPT-6.2 Astra] FlyMachinesRuntime (restart, Astra): ephemeral Fly Machine per run, one authoritative output path #3801 a review finished at 7/10 with blockers, and the next /ultrafix opened with a new review that scored 5.
    • The fix-step selector and /fix share one "unaddressed since the last fix" definition (gatherUnprocessedReviewComments). Ultrafix startup should use exactly that definition instead of a narrower one.

    Proposed:

    • If older PR work is still in flight, wait for it to settle (the loop already has a deferred-resume path) and re-evaluate. Don't force a review.
    • First action = fix if /fix would select anything (unaddressed findings, or non-empty instructions, or both). Otherwise review.
    • Add acceptance cases: a pending review with blockers plus a just-settled earlier job → fix first; findings already addressed by a later /fix → review first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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