Skip to content

Conversation

dedrisian-oai
Copy link
Collaborator

@dedrisian-oai dedrisian-oai commented Sep 10, 2025

📝 Review Mode -- Core

This PR introduces the Core implementation for Review mode:

  • New op Op::Review { prompt: String }: spawns a child review task with isolated context, a review‑specific system prompt, and a Config.review_model.
  • EnteredReviewMode: emitted when the child review session starts. Every event from this point onwards reflects the review session.
  • ExitedReviewMode(Option<ReviewOutputEvent>): emitted when the review finishes or is interrupted, with optional structured findings:
{
  "findings": [
    {
      "title": "<≤ 80 chars, imperative>",
      "body": "<valid Markdown explaining *why* this is a problem; cite files/lines/functions>",
      "confidence_score": <float 0.0-1.0>,
      "priority": <int 0-3>,
      "code_location": {
        "absolute_file_path": "<file path>",
        "line_range": {"start": <int>, "end": <int>}
      }
    }
  ],
  "overall_correctness": "patch is correct" | "patch is incorrect",
  "overall_explanation": "<1-3 sentence explanation justifying the overall_correctness verdict>",
  "overall_confidence_score": <float 0.0-1.0>
}

Questions

Why separate out its own message history?

We want the review thread to match the training of our review models as much as possible -- that means using a custom prompt, removing user instructions, and starting a clean chat history.

We also want to make sure the review thread doesn't leak into the parent thread.

Why do this as a mode, vs. sub-agents?

  1. We want review to be a synchronous task, so it's fine for now to do a bespoke implementation.
  2. We're still unclear about the final structure for sub-agents. We'd prefer to land this quickly and then refactor into sub-agents without rushing that implementation.

@dedrisian-oai dedrisian-oai marked this pull request as ready for review September 10, 2025 03:00
Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Copy link
Contributor

@jif-oai jif-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of not necessary clone()
Handling the memory in Rust is not easy but we should not take the habit to clone everything as it can have a large impact on performances at large scale

Copy link
Collaborator

@pakrym-oai pakrym-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few comments. The main one (but non-blocking) is around removing is_review_mode from the session and encapsulating it in the Task::review() overload.

@zemaj
Copy link

zemaj commented Sep 12, 2025

This is a great feature! Can't wait to see how it performs.

It looks like the review thread only gets custom instructions + whatever input the /review is called with.

If /review is used without any input would it make sense to give the thread a curated view of recent activity? i.e. recent user instructions and perhaps just the patches applied or recent tool calls? Or does this not make sense given how the review models are trained?

Copy link
Collaborator

@pakrym-oai pakrym-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall layering looks good, please address @jif-oai's comments before merging.

Copy link
Contributor

@jif-oai jif-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the pipeline but LGTM 👍

@dedrisian-oai dedrisian-oai enabled auto-merge (squash) September 12, 2025 23:18
@dedrisian-oai dedrisian-oai merged commit 90a0fd3 into main Sep 12, 2025
19 checks passed
@dedrisian-oai dedrisian-oai deleted the daniel/review-mode-core branch September 12, 2025 23:25
@github-actions github-actions bot locked and limited conversation to collaborators Sep 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants