Skip to content

fix(sessions): include remote default branch changes in review - #144246

Merged
obviyus merged 3 commits into
openclaw:mainfrom
zhangguiping-xydt:fix/issue-144205-remote-main-base
Sep 10, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
zhangguiping-xydt:fix/issue-144205-remote-main-base

Conversation

@zhangguiping-xydt

@zhangguiping-xydt zhangguiping-xydt commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Problem and fix

Fixes #144205. Review's All Changes omitted committed branch work when a feature checkout had origin/main or origin/master, but no origin/HEAD or local default branch. The resolver fell back to HEAD, which made All Changes look like Uncommitted and hid branch history.

The existing resolver now tries those two remote-tracking refs after symbolic and local defaults. It uses local Git reads and the existing merge-base path. Uncommitted keeps its HEAD comparison; session-start filtering, commit ancestry checks, and explicit repository bases retain their existing behavior.

Validation

  • Real isolated Gateway and served Control UI reproduced the failure on pinned main. The proof settled a session baseline through ordinary /status before creating committed, uncommitted, and untracked work.

  • New real-Git remote-main and remote-master cases failed on baseline; the local-main control passed.

  • 69 focused tests passed across resolver precedence, baseline lifecycle, Gateway diff scopes and safety controls, and live/stopped repository paths.

  • Formatting, syntax lint, line-count and assertion-safety checks, and the normal commit hook passed.

  • Candidate 424dd2880e15 restored the committed file and branch history in the same original session, repository and served Review UI. Uncommitted retained only tracked/untracked working changes.

  • A separate fresh-session control hid all preexisting work after baseline capture. The original session remained unchanged. No model inference was required.

  • Independent public reads and browser controls checked All, Uncommitted, the advertised commit, and explicit rejection of the base and an unknown commit. A capture-wrapper cleanup failure was retained; a focused recovery verified normal shutdown and unchanged refs without repeating the completed behavior cases.

Preserves the original contributor commits and credit. Full suites and type checks run in hosted CI.

@clawsweeper

clawsweeper Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 10, 2026
@clawsweeper

clawsweeper Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 3:19 PM ET / 19:19 UTC (Revision 3).

ClawSweeper review

What this changes

The session Review panel now includes committed branch changes when only origin/main or origin/master identifies the default branch, with regression coverage for diff scopes and precedence.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix: current main and the latest release still omit the remote-only fallback. The supplied real-flow observations support the repair, and no blocking defect was found.

Priority: P2
Reviewed head: 424dd2880e1579cb5ba4943851481c6b1d83101b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow owner-level repair with relevant regression coverage and concrete submitted real-flow observations.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured PR body records the changed resolver exercised through a real isolated Gateway and served Review UI: the same-session after-fix run restores committed work and history while Uncommitted, fresh-session baseline filtering, and invalid-commit rejection remain correct.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured PR body records the changed resolver exercised through a real isolated Gateway and served Review UI: the same-session after-fix run restores committed work and history while Uncommitted, fresh-session baseline filtering, and invalid-commit rejection remain correct.
Evidence reviewed 9 items Current main still needs the fix: The fetched main resolver checks symbolic origin/HEAD, then local main/master, and otherwise returns HEAD; it does not independently try remote main/master.
Latest release has the same omission: The resolver in v2026.9.3 also lacks the two remote-tracking fallback candidates.
Introduced change and review continuity: The pinned merge-base-to-head delta changes only the resolver candidate list and its two test files. The production resolver is unchanged from the previously reviewed head; the prior review projection contains no findings. Endpoint drift was excluded from PR ownership.
Findings None None.
Security None None.

How this fits together

The Gateway computes session Review data from the session’s Git checkout. Its base resolver determines which committed changes appear alongside working changes before session-start filtering produces the result shown in the Control UI.

flowchart TD
  A[Review request] --> B[Session checkout]
  B --> C[Resolve default branch and merge base]
  C --> D[Select All, Uncommitted, or Commit scope]
  D --> E[Collect changes and branch history]
  E --> F[Apply session baseline where applicable]
  F --> G[Review panel]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source 0, Tests +86. Total +86 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 2 155 69 +86
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 156 70 +86

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #144205
Summary: This PR is the implementation candidate for the linked remote-default discovery defect; the issue should remain open until resolution.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep default-branch discovery in the existing resolver, preserving symbolic/local precedence, explicit bases, and the existing scope and baseline contracts.

Do we have a high-confidence way to reproduce the issue?

Yes. Current source deterministically falls back to HEAD on a feature branch with remote main/master but no symbolic or local default; the supplied body also records a real Gateway/UI reproduction. This review did not execute it.

Is this the best way to solve the issue?

Yes. Extending the existing fallback list repairs automatic discovery without adding another owner, configuration option, network lookup, or repository mutation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 441761374758.

Labels

Label justifications:

  • P2: This fixes misleading Review output for a specific Git ref layout without changing repository data.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured PR body records the changed resolver exercised through a real isolated Gateway and served Review UI: the same-session after-fix run restores committed work and history while Uncommitted, fresh-session baseline filtering, and invalid-commit rejection remain correct.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured PR body records the changed resolver exercised through a real isolated Gateway and served Review UI: the same-session after-fix run restores committed work and history while Uncommitted, fresh-session baseline filtering, and invalid-commit rejection remain correct.

Evidence

What I checked:

  • Current main still needs the fix: The fetched main resolver checks symbolic origin/HEAD, then local main/master, and otherwise returns HEAD; it does not independently try remote main/master. (src/sessions/session-diff-revisions.ts:34, 441761374758)
  • Latest release has the same omission: The resolver in v2026.9.3 also lacks the two remote-tracking fallback candidates. (src/sessions/session-diff-revisions.ts:34, 1391f7cd2d40)
  • Introduced change and review continuity: The pinned merge-base-to-head delta changes only the resolver candidate list and its two test files. The production resolver is unchanged from the previously reviewed head; the prior review projection contains no findings. Endpoint drift was excluded from PR ownership. (src/sessions/session-diff-revisions.ts:34, 424dd2880e15)
  • Existing owner and preserved safeguards: Both checkout collection and baseline capture use the same resolver. Explicit bases bypass discovery, Uncommitted still compares against HEAD, and commit requests retain ancestry checks. This path uses OpenClaw's local Git implementation and establishes no Codex dependency requirement. (src/sessions/session-diff.ts:417, 424dd2880e15)
  • Meaningful regression coverage: The real-Git cases cover local main, remote main, and remote master across All, Uncommitted, and Commit scopes, including rejection of sibling, base, and unknown commits. Resolver tests distinguish competing defaults. Tests were inspected, not executed in this read-only review. (src/gateway/server-methods/sessions-diff.test.ts:351, 424dd2880e15)
  • Captured real-flow observations: The supplied complete PR body records an isolated Gateway and served Control UI reproducing the omission, then candidate 424dd28 restoring the committed file and history in the same session and checkout. It records preserved Uncommitted results, fresh-session filtering, rejected commit controls, and cleanup recovery. These are submitted observations, not reviewer-executed results; no separate media attachment was supplied. Captured context sourceRevision: 7d888a23db6973d75cb71125f874d15a910a0764ba53021c6e33519e0ed8fa06. (424dd2880e15)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-10T17:45:59.072Z sha be48568 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-10T18:05:39.532Z sha 21c1585 :: needs maintainer review before merge. :: none

@obviyus obviyus self-assigned this Sep 10, 2026
Preserve local and symbolic default precedence while resolving remote-only
main and master refs through the existing merge-base flow. Cover branch,
working-tree and commit scopes against real repositories, and distinguish
competing valid default refs in precedence tests.
@obviyus
obviyus requested a review from a team as a code owner September 10, 2026 19:12
@obviyus obviyus changed the title fix(sessions): include remote default branches in diffs fix(sessions): include remote default branch changes in review Sep 10, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes scripts Repository scripts commands Command implementations agents Agent runtime and tooling extensions: minimax extensions: codex size: XL triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed size: S labels Sep 10, 2026
@obviyus
obviyus merged commit 21eb84f into openclaw:main Sep 10, 2026
227 of 228 checks passed
@obviyus

obviyus commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Thanks @zhangguiping-xydt!

Bug: All Changes omitted committed branch work when the checkout had only a remote-tracking default branch.

Fix: The existing merge-base resolver now checks origin/main and origin/master after symbolic and local defaults.

Proof: A real Gateway and served Review reproduced the omission on main and restored the committed file and history in the same original session. Independent API/browser controls preserved Uncommitted, commit rejection, and session-start filtering. All 69 focused tests and exact-head review passed.

Before After
All Changes showed only dirty files and no branch history All Changes includes committed work, dirty files, the merge base, and branch history
Uncommitted showed tracked and untracked work Uncommitted preserves the same scope

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 11, 2026
…law#144246)

## Problem and fix

Fixes openclaw#144205. Review's All Changes omitted committed branch work when a feature checkout had `origin/main` or `origin/master`, but no `origin/HEAD` or local default branch. The resolver fell back to `HEAD`, which made All Changes look like Uncommitted and hid branch history.

The existing resolver now tries those two remote-tracking refs after symbolic and local defaults. It uses local Git reads and the existing merge-base path. Uncommitted keeps its `HEAD` comparison; session-start filtering, commit ancestry checks, and explicit repository bases retain their existing behavior.

## Validation

- Real isolated Gateway and served Control UI reproduced the failure on pinned main. The proof settled a session baseline through ordinary `/status` before creating committed, uncommitted, and untracked work.
- New real-Git remote-main and remote-master cases failed on baseline; the local-main control passed.
- 69 focused tests passed across resolver precedence, baseline lifecycle, Gateway diff scopes and safety controls, and live/stopped repository paths.
- Formatting, syntax lint, line-count and assertion-safety checks, and the normal commit hook passed.

- Candidate `424dd2880e15` restored the committed file and branch history in the same original session, repository and served Review UI. Uncommitted retained only tracked/untracked working changes.
- A separate fresh-session control hid all preexisting work after baseline capture. The original session remained unchanged. No model inference was required.
- Independent public reads and browser controls checked All, Uncommitted, the advertised commit, and explicit rejection of the base and an unknown commit. A capture-wrapper cleanup failure was retained; a focused recovery verified normal shutdown and unchanged refs without repeating the completed behavior cases.

Preserves the original contributor commits and credit. Full suites and type checks run in hosted CI.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui cli CLI command changes commands Command implementations docs Improvements or additions to documentation extensions: codex extensions: minimax gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: All changes misses branch commits when origin/HEAD is absent

2 participants