Skip to content

Fix "cannot detect diffs" error#12126

Open
MaggieShan wants to merge 1 commit into
masterfrom
maggs/fix-diff-state-not-in-repo-bug
Open

Fix "cannot detect diffs" error#12126
MaggieShan wants to merge 1 commit into
masterfrom
maggs/fix-diff-state-not-in-repo-bug

Conversation

@MaggieShan
Copy link
Copy Markdown
Contributor

Description

  • This fixes an issue where the code review view would occasionally flash the "cannot detect diffs" error despite being in a git repo with valid diffs to render
  • The bug is that a local diff state model defaults to DiffState::NotInRepository on creation which the view maps to this error message
    • This used to work when the view also treated NotInRepository as a loading state if repo_path.is_some(), but with the refactors made to support a remote diff state model, the semantics for NotInRepository changed to be a valid error where the path was definitively not inside a git repo
  • The fix introduces a new starting state where DiffState::Detecting explicitly means that we're actively detecting the repo before loading the diffs

Linked Issue

Reported in:

Testing

https://www.loom.com/share/7bab61e0fe624f4d8a5cdfc440e28258

  • I have manually tested my changes locally with ./script/run

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

@cla-bot cla-bot Bot added the cla-signed label Jun 3, 2026
@MaggieShan MaggieShan marked this pull request as ready for review June 3, 2026 14:17
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Jun 3, 2026

@MaggieShan

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@MaggieShan MaggieShan requested a review from kevinchevalier June 3, 2026 14:19
Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR introduces an explicit Detecting internal state for the local diff model, maps that in-progress state to DiffState::Loading, and only emits NotInRepository after repository detection definitively fails.

Concerns

  • No blocking correctness, security, or spec-drift concerns found in the changed lines.
  • The PR description includes a Loom recording, satisfying the repo visual-evidence requirement for this user-facing behavior.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@kevinchevalier kevinchevalier left a comment

Choose a reason for hiding this comment

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

Nice! This makes the state clear!

@MaggieShan MaggieShan enabled auto-merge (squash) June 3, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants