Skip to content

fix(ui): hide session changes outside Git checkouts - #122152

Merged
vyctorbrzezowski merged 1 commit into
openclaw:mainfrom
vyctorbrzezowski:brzezowski/control-ui-hide-nongit-diff
Aug 11, 2026
Merged

vyctorbrzezowski merged 1 commit into
openclaw:mainfrom
vyctorbrzezowski:brzezowski/control-ui-hide-nongit-diff

Conversation

@vyctorbrzezowski

Copy link
Copy Markdown
Member

Closes #122147

What Problem This Solves

Fixes an issue where users opening a Control UI chat outside a Git checkout would see a disabled Session changes icon that could not provide a useful result.

Why This Change Was Made

In this PR, the workspace capability owner omits every Session changes entry point when the live sessions.files.list result says gitCheckout: false. A terminal chat event refreshes that fact once per completed run, so an agent-created checkout such as git init makes the action appear without polling. Gateways that omit the newer field remain fail-open and keep the existing panel fallback.

This follows the existing header pattern: terminal, desktop, discussion, tasks, and split actions are conditionally present when their callbacks are available, and the header has no fixed-slot layout contract. It also removes the now-obsolete disabled quick-action seam.

User Impact

Non-Git sessions no longer advertise an unusable diff action. If the same session becomes a Git checkout during a run, Session changes appears after that run completes.

Evidence

Before

The non-Git workspace shows a disabled diff glyph whose tooltip only explains that it cannot work.

Before: disabled Session changes glyph in a non-Git workspace

After

In this PR, the unusable action is omitted while the rest of the header remains unchanged.

After: Session changes glyph omitted in a non-Git workspace

Validation

  • Pre-fix browser regression: failed with one visible toggle where zero was expected.
  • Focused Testbox proof: 3 session-diff E2E tests and 7 header-menu unit tests passed.
  • The E2E proof covers gitCheckout: false, same-session transition to true after a terminal run, and the legacy undefined fallback.
  • Path-scoped changed-file gate passed: formatting, i18n, dependency guards, dead exports, core/UI typechecks, and lint.
  • Autoreview: clean, no actionable findings; TruffleHog clean.

Production delta is +7 lines. The net growth is the bounded terminal-run refresh needed to make the live Git capability reactive; connected disabled-state policy was removed. Tests are +6 net lines.

@vyctorbrzezowski vyctorbrzezowski self-assigned this Aug 11, 2026
@clawsweeper

clawsweeper Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 11, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 Aug 11, 2026
@clawsweeper

clawsweeper Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 11, 2026, 12:59 PM ET / 16:59 UTC.

ClawSweeper review

What this changes

This PR hides Session changes for a workspace explicitly reported as outside Git and refreshes that capability after a matching chat run ends.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. The patch is an owner-aligned fix with no actionable correctness findings; the maintainer label requires normal maintainer handling after exact-head CI and the latest ClawSweeper rank-up moves are checked.

Priority: P3
Reviewed head: 953c78d1583f4c8ebef108e04d05a97750c38dce

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has direct UI proof and an owner-aligned implementation; exact-head CI remains the final merge gate.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The PR body provides direct before/after Control UI screenshots and a focused mocked-Gateway browser scenario for false, true-after-terminal, and undefined checkout states; the screenshots could not be re-fetched because GitHub DNS was unavailable.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The PR body provides direct before/after Control UI screenshots and a focused mocked-Gateway browser scenario for false, true-after-terminal, and undefined checkout states; the screenshots could not be re-fetched because GitHub DNS was unavailable.
Evidence reviewed 7 items Current fake-door path: Current main creates the diff callback whenever the Gateway advertises sessions.diff, then disables its header, title-bar, and rail controls when the workspace fact is false.
Authoritative producer: The Gateway derives gitCheckout using git rev-parse at the same workspace CWD used by sessions.diff; its focused test proves false becomes true after git init.
Protocol compatibility: gitCheckout is optional when the root is unknown or a Gateway predates the field, matching the PR’s intended undefined-value fallback.
Findings None None.
Security None None.

How this fits together

The Control UI builds chat-header and workspace-rail actions from Gateway workspace facts for the active session. Those facts determine whether opening the session-diff panel is meaningful.

flowchart LR
  A[Workspace directory] --> B[Gateway Git probe]
  B --> C[Session workspace state]
  D[Chat run terminal event] --> E[Bounded workspace refresh]
  E --> C
  C --> F[Session changes action]
  F --> G[Diff panel]
Loading

Before merge

  • Resolve merge risk (P1) - The local partial clone could not retrieve the complete PR tree or linked media while GitHub DNS was unavailable; this does not negate the contributor’s supplied UI proof.
  • Complete next step (P2) - This maintainer-labeled PR needs the normal exact-head CI and rank-up-move review rather than an automated repair.
Agent review details

Security

None.

PR surface

Source +7, Tests +6. Total +13 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 4 31 24 +7
Tests 2 23 17 +6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 54 41 +13

Review metrics

Metric Value Why it matters
Production versus test delta production +31/-24 (net +7); tests +23/-17 (net +6) The patch deletes the disabled-state seam while adding one bounded lifecycle refresh and browser regression coverage.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #122147
Summary: This PR is the candidate fix for the paired Control UI non-Git diff-control report.

Members:

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

Merge-risk options

  • Before merge, review the latest ClawSweeper comment’s rank-up moves and wait for the in-progress exact-head required checks.

Maintainer options:

  1. Decide the mitigation before merge
    Gate every Session changes entry point on the workspace owner’s explicit false value, refresh that fact once after a matching terminal event, and preserve the fallback for Gateways that omit the field.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Gate every Session changes entry point on the workspace owner’s explicit false value, refresh that fact once after a matching terminal event, and preserve the fallback for Gateways that omit the field.

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

Yes—the current browser E2E produces gitCheckout: false and observes the disabled control; the PR changes that exact scenario to require absence and post-terminal reappearance.

Is this the best way to solve the issue?

Yes—the Gateway owns checkout detection, and a matching terminal chat event is the bounded point at which an agent-created checkout can become available; polling or a static session gate would be weaker.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 82ba647673f9.

Labels

Label changes:

  • add P3: This corrects a misleading but recoverable Control UI affordance with limited blast radius.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides direct before/after Control UI screenshots and a focused mocked-Gateway browser scenario for false, true-after-terminal, and undefined checkout states; the screenshots could not be re-fetched because GitHub DNS was unavailable.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body provides direct before/after Control UI screenshots and a focused mocked-Gateway browser scenario for false, true-after-terminal, and undefined checkout states; the screenshots could not be re-fetched because GitHub DNS was unavailable.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR body provides direct before/after Control UI screenshots and a focused mocked-Gateway browser scenario for false, true-after-terminal, and undefined checkout states; the screenshots could not be re-fetched because GitHub DNS was unavailable.

Label justifications:

  • P3: This corrects a misleading but recoverable Control UI affordance with limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR body provides direct before/after Control UI screenshots and a focused mocked-Gateway browser scenario for false, true-after-terminal, and undefined checkout states; the screenshots could not be re-fetched because GitHub DNS was unavailable.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides direct before/after Control UI screenshots and a focused mocked-Gateway browser scenario for false, true-after-terminal, and undefined checkout states; the screenshots could not be re-fetched because GitHub DNS was unavailable.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body provides direct before/after Control UI screenshots and a focused mocked-Gateway browser scenario for false, true-after-terminal, and undefined checkout states; the screenshots could not be re-fetched because GitHub DNS was unavailable.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Commit 6b470b1 names and predates the disabled non-Git diff behavior this PR replaces. (role: introduced the prior non-Git mitigation; confidence: high; commits: 6b470b1fe8e7; files: ui/src/pages/chat/components/chat-session-workspace.ts, ui/src/pages/chat/chat-pane-header.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Wait for the in-progress exact-head required checks before merge.

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.

@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Landing gate complete:

  • Latest exact-head review has no actionable findings; its only rank-up move, waiting for required CI, is satisfied.
  • Sequential owner/source, structured branch, and exact-head maintainer review passes completed cleanly.
  • All 105 exact-head checks completed without failure, including the required openclaw/ci-gate.
  • The native Testbox-backed prepare gate passed for 953c78d1583f4c8ebef108e04d05a97750c38dce.

Proceeding through the native atomic merge gate.

@vyctorbrzezowski
vyctorbrzezowski merged commit 2c636dd into openclaw:main Aug 11, 2026
105 checks passed
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Control UI shows unusable session changes action outside Git checkouts

1 participant