Skip to content

fix: avoid loading patches for environment change totals - #189571

Merged
steipete merged 1 commit into
mainfrom
steipete/perf-micro-sessions-diff-git-cost-20260919
Oct 31, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/perf-micro-sessions-diff-git-cost-20260919

Conversation

@steipete

@steipete steipete commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Environment change totals request full patches and branch history even though they only display counts.

User Impact

Environment totals do less Git work and allocate less memory. Opening Review still loads the full patch. There is no visual or protocol change.

Why This Change Was Made

Use the existing summaryOnly request and share concurrent reads only when their summary/full shape matches. Preserve explicit refresh and latest-request publication. No server cache, TTL, configuration, or database change. Runtime code grows by eight lines for the two independent in-flight slots.

The benchmark tool now supports 501 content-changing history commits and a recorded base. A separate native diagnostic reproduces missing-object promisor-pack traversal. Server pathspec and local-object guard candidates were rejected after slower healthy-repository measurements; this PR does not claim to solve all partial-clone IO.

Evidence

  • UI regression: original base 33 pass / two expected failures; owner/panel/readiness siblings 82/82. Existing Git-read sharing and commit/working-tree invalidation tests pass.
  • Synthetic 202,006-file / 1.1 GB checkout, 501 historical commits, 2,004 tracked changes: five samples per arm in A/S/S/A order. Full owner p50 1,701 / 3,779 ms; summary 739 / 687 ms. The A/A drift limits wall-time conclusions.
  • Git commands 11 -> 7; captured output 980,355 -> 148,459 bytes; response 257,032 -> 38,449 bytes. JS-thread CPU p50 40.1 / 45.3 -> 17.3 / 17.5 ms. Separate sampled-allocation median 11,715,272 -> 5,374,680 bytes (54.1% less).
  • Captured bytes are not physical disk IO; measurements use APFS, not btrfs. No production data copied.
  • Two isolated RPC clients shared one cold checkout computation and received the expected 504 files. Final owner benchmarks use the unchanged backend after removing rejected experiments.
  • Codex autoreview: no actionable P0-P2 findings. Test-line ratchet passes.
  • pnpm check:changed: inherited Knip unused export resolveTtsDirectiveBody, reproduced on exact parent 82639fac241419cb72e6802e75e91c020d36b325, introduced by ec004ac80b18e7fb97a52f45a6f1ead13c53ad38 (refactor(tts): isolate streaming directive text from provider discovery #189504). This is an existing main regression, outside this change. Final rerun completed: this is the only failure; all other checks passed. Exact-head CI is green (run 41222494791) at 64975d1b2be082db71e64cd359b29b014fb86c09.

@clawsweeper

clawsweeper Bot commented Oct 31, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui scripts Repository scripts size: M labels Oct 31, 2026
@steipete
steipete marked this pull request as ready for review October 31, 2026 17:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T17:03:52.764441Z 64975d1 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Environment totals request counts only, while Review retains separate full-patch requests.

Example: Environment displays changed.ts with one addition and no deletions.

  • Before: Displaying +1 also requests patches and branch history.
  • After: Displaying +1 requests a summary; opening Review separately requests the patch.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, useful patch with green exact-head CI and meaningful owner regressions; direct runtime evidence for the changed UI path remains limited.
Proof confidence 🦐 gold shrimp (3/6) The maintainer-authored PR is outside the ordinary contributor proof gate; supplied synthetic owner measurements and two-client RPC results exercise the unchanged backend, while the changed UI owner is covered by mocked-RPC regression tests rather than a browser trace.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Displaying Environment totals performs patch and branch-history work that the totals do not consume.
Reason: The maintainer-authored direction removes measurable work using an existing capability, without changing runtime configuration, defaults, permissions, or presentation.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR removes unnecessary Git work through the existing diff owner, remains necessary on current main, and has no identified correctness or security findings.

Priority: P2
Reviewed head: 64975d1b2be082db71e64cd359b29b014fb86c09

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence does not demonstrate the changed Environment-to-Review UI request sequence through a running browser and Gateway.
Agent review details

How this fits together

The Control UI workspace diff owner translates Environment and Review demand into sessions.diff RPC requests and publishes checkout-scoped results.

flowchart LR
  E[Environment totals] --> O[Workspace diff owner]
  R[Review panel] --> O
  O --> S[Summary request]
  O --> F[Full patch request]
  S --> G[Gateway sessions diff]
  F --> G
  G --> C[Checkout diff owner]
Loading

Technical review

Best possible solution:

Use the existing summaryOnly contract within the workspace owner, retaining separate full-patch reads and explicit refresh semantics.

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

Current-main source directly shows Environment requesting full diffs for counts, and the PR reports two expected base failures; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The runtime fix is appropriately small: select the existing summary contract and distinguish in-flight response shapes within the existing owner; the two new flags affect benchmark tooling only.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

  • Introduced runtime change: The pinned introduced diff selects summaryOnly for Environment demand, separates in-flight requests by response shape, and retains explicit refresh and latest-request publication. (ui/src/pages/chat/components/chat-session-workspace-diff.ts:38, 64975d1b2be0)
  • Current main still performs the unnecessary request: Fetched main still calls the shared uncommitted loader without summaryOnly when Environment requests totals. (ui/src/pages/chat/components/chat-session-workspace-diff.ts:79, 71a4644c050b)
  • Existing backend capability: The existing checkout owner suppresses branch history and patch collection for summaryOnly requests while retaining file counts; no backend implementation or protocol extension is needed. (src/sessions/session-diff.runtime.ts:402, 64975d1b2be0)
  • Distinct regression coverage: The added owner test interleaves summary and full reads, verifies matching requests share work, and verifies the patch consumer receives patch content rather than the summary. (ui/src/pages/chat/components/chat-session-workspace.test.ts:395, 64975d1b2be0)
  • Supplied performance evidence: The complete PR body reports Git commands decreasing from 11 to 7 and sampled allocations from 11,715,272 to 5,374,680 bytes on synthetic data; it explicitly limits latency conclusions because of A/A drift and does not claim physical disk savings. (64975d1b2be0)
  • Exact-head CI and mergeability: Live REST reads report the reviewed head as cleanly mergeable, with a successful CI gate and no failed or unfinished check runs across both check-run pages; the PR body's pending local rerun is historical. (64975d1b2be0)

PR surface

Source +8, Tests +39, Docs +2, Other +193. Total +242 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 18 10 +8
Tests 1 39 0 +39
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 3 198 5 +193
Total 7 257 15 +242

Labels

Label changes:

  • add P2: Avoids unnecessary Git commands and allocations when displaying Environment totals, with limited functional blast radius.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Avoids unnecessary Git commands and allocations when displaying Environment totals, with limited functional blast radius.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

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

  • Capture a redacted browser RPC trace showing counts-only Environment demand followed by a separate full-patch Review request.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 31, 2026, 1:18 PM ET / 17:18 UTC.

@steipete
steipete merged commit b873e69 into main Oct 31, 2026
184 of 188 checks passed
@steipete
steipete deleted the steipete/perf-micro-sessions-diff-git-cost-20260919 branch October 31, 2026 17:52
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 31, 2026
…189696)

* test(ui): align disk badges and Review loading checks

Update the disk-pressure scenario for healthy worker badges restored in #189526. Keep Environment summary reads separate from the deferred Review patch request introduced in #189571, and assert the rendered patch after opening its file.

* test(ui): keep Review request assertions type-safe

* fix(test): allow offline placement recovery reload

* fix(test): retain automation row contract after reload
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 1, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 1, 2026
…penclaw#189696)

* test(ui): align disk badges and Review loading checks

Update the disk-pressure scenario for healthy worker badges restored in openclaw#189526. Keep Environment summary reads separate from the deferred Review patch request introduced in openclaw#189571, and assert the rendered patch after opening its file.

* test(ui): keep Review request assertions type-safe

* fix(test): allow offline placement recovery reload

* fix(test): retain automation row contract after reload
tideclaw-bot pushed a commit that referenced this pull request Nov 3, 2026
…189696)

* test(ui): align disk badges and Review loading checks

Update the disk-pressure scenario for healthy worker badges restored in #189526. Keep Environment summary reads separate from the deferred Review patch request introduced in #189571, and assert the rendered patch after opening its file.

* test(ui): keep Review request assertions type-safe

* fix(test): allow offline placement recovery reload

* fix(test): retain automation row contract after reload

(cherry picked from commit 01ac91c)
Co-authored-by: RomneyDa <[email protected]>
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 docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: M 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.

1 participant