Skip to content

Conversation

@zemaj
Copy link

@zemaj zemaj commented Oct 27, 2025

feat(auto-drive): launch commit review after diagnostics

Copy link

@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 automated review suggestions for this pull request.

ℹ️ 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
  • 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 address that feedback".

Comment on lines +13924 to +13940
pub(crate) fn handle_auto_review_commit_ready(&mut self, outcome: AutoReviewOutcome) {
self.auto_review_pending = false;
match outcome {
AutoReviewOutcome::Skip { reason } => {
self.pending_review_commit = None;
self.push_background_tail(format!("Auto Drive review skipped: {reason}"));
self.cleanup_active_review_worktree();
}
AutoReviewOutcome::Error(err) => {
self.pending_review_commit = None;
self.push_background_tail(format!("Auto Drive review prep failed: {err}"));
tracing::warn!("auto_review_prep_failed" = %err);
self.cleanup_active_review_worktree();
}
AutoReviewOutcome::Commit(prepared) => {
self.launch_commit_review(prepared);
}

Choose a reason for hiding this comment

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

P1 Badge Skip commit review when Auto Drive is no longer active

When the async preparation for a commit review completes, handle_auto_review_commit_ready always calls launch_commit_review for a Commit outcome. If the user has already stopped Auto Drive while the preparation was running, auto_stop clears pending_review_commit and marks the state idle but nothing prevents this handler from firing afterwards. The review UI is then launched unexpectedly and a review worktree is created even though the run was cancelled, which leaves no cleanup path because the stop logic already ran. Guard the launch with a check such as self.auto_state.is_active() (and clean up the worktree otherwise) so that cancelling Auto Drive while a review is being prepared does not reopen the workflow or leak resources.

Useful? React with 👍 / 👎.

@zemaj zemaj force-pushed the main branch 2 times, most recently from 804b5ad to b7927a2 Compare October 28, 2025 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants