Skip to content

fix(ui): label created files accurately in tool activity - #122287

Merged
vyctorbrzezowski merged 1 commit into
mainfrom
brzezowski/control-ui-factrow
Aug 11, 2026
Merged

vyctorbrzezowski merged 1 commit into
mainfrom
brzezowski/control-ui-factrow

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Aug 11, 2026 •

Copy link
Copy Markdown
Member

Closes #122267

What Problem This Solves

Fixes an issue where users reviewing a successful Codex file creation in Control UI would see Edited even though the recorded operation was add. Mixed patch activity was also collapsed into an all-edits count.

Why This Change Was Made

The producer already records the authoritative operation: OpenClaw's Codex projector preserves each change.kind, matching upstream Codex's PatchChangeKind::{Add, Delete, Update} contract. The loss happened in the Control UI projection, which treated every parsed patch as an edit.

This PR carries those existing operations through the patch view model. Tool rows derive Created, Edited, Deleted, or Changed from that fact, and grouped activity counts file operations separately. It does not change gateway, protocol, config, storage, or provider behavior.

Dependency contract checked directly in the required sibling ../codex checkout at openai/codex@f344a80a3b4a2e9a3f70f04526c77c6a979f5fb4 (the links below are citations, not substitutes for that inspection):

User Impact

Operators can trust the activity row to say what happened: a newly created file now appears as Created, and mixed patch summaries no longer report creations or deletions as edits.

Evidence

The same realistic turn runs on both sides: the user requests a release-helper change, the agent explains the plan, applies one mixed patch containing add/update/delete operations, runs a focused command, and reports the result. Before the production change, the regression test captures both themes and then fails because the group says Ran a command, edited 3 files instead of preserving the three recorded operation kinds.

Light

View Before In this PR
Full chat context Before: realistic light-mode chat collapses mixed file operations into edits After: realistic light-mode chat preserves create, edit, and delete operations
Activity rows Before: light-mode activity rows say Edited 3 files After: light-mode activity rows say Changed 3 files and list each operation kind

Dark

View Before In this PR
Full chat context Before: realistic dark-mode chat collapses mixed file operations into edits After: realistic dark-mode chat preserves create, edit, and delete operations
Activity rows Before: dark-mode activity rows say Edited 3 files After: dark-mode activity rows say Changed 3 files and list each operation kind

Validated on f9e14495d6732ede6875a30744923aa609254e08:

  • pnpm ui:i18n:verify
  • node scripts/run-vitest.mjs ui/src/lib/chat/tool-call-view.test.ts ui/src/lib/chat/tool-call-grouping.test.ts ui/src/pages/chat/components/chat-tool-cards.test.ts — 118 passed
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-tool-turn-outcome.e2e.test.ts -t "preserves mixed producer" — 1 passed; the same fixture fails on main after capturing the before images
  • autoreview --mode branch --base origin/main — clean, no accepted/actionable findings

The Blacksmith Testbox changed gate did not start because its lease remained queued without a host; tbx_01kzsby65vs1wr968hq479bzch was stopped. Exact-head PR CI run 31540614502 completed successfully, including check-dependencies, checks-ui, Control UI E2E, and openclaw/ci-gate.

Production delta is +141/-82 (net +59); tests are +191/-4. The production growth is the operation fact carried through the existing view model plus the visible verb states. The grouped-count owner was refactored to absorb per-operation counting at net +2. No runtime path was duplicated or retained for compatibility.

@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.

@vyctorbrzezowski vyctorbrzezowski self-assigned this Aug 11, 2026
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Aug 11, 2026
@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review August 11, 2026 21:40
@vyctorbrzezowski
vyctorbrzezowski force-pushed the brzezowski/control-ui-factrow branch from c9e1b5e to f9e1449 Compare August 11, 2026 22:01
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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, 6:07 PM ET / 22:07 UTC.

ClawSweeper review

What this changes

The PR carries parsed patch add, update, and delete operations into Control UI activity rows and grouped summaries so created and deleted files are not reported as edits.

Regression provenance

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

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

The branch is a focused repair of an operator-visible Control UI mislabel; no patch defect was found, but this member-authored, maintainer-labeled PR still needs the upstream Codex contract confirmed from a permitted sibling checkout before merge.

Priority: P2
Reviewed head: f9e14495d6732ede6875a30744923aa609254e08
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-covered UI repair with no identified code defect; direct upstream-contract verification remains a maintainer gate in this environment.
Proof confidence 🌊 off-meta tidepool Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR nevertheless includes before/after UI screenshots and a browser scenario.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR nevertheless includes before/after UI screenshots and a browser scenario.
Evidence reviewed 5 items Current-main defect: Current Control UI parsing recognizes patch sections but resolvePatchView assigns every parsed patch the presentation kind edit, so a structured add loses its authoritative operation before row rendering.
Authoritative producer fact: The Codex app-server projector carries each file-change kind and path into transcript arguments, and its regression test covers update, add, and delete records.
Branch repair and coverage: The branch adds operation metadata to the parsed patch view, derives row verbs from it, and exercises mixed add/update/delete activity in a browser scenario plus focused unit tests.
Findings None None.
Security None None.

How this fits together

The Codex app-server projector records file-change metadata in transcript tool calls, which the Control UI parses into activity rows and collapsed work-group summaries. This PR changes that final presentation layer, not gateway or provider behavior.

flowchart LR
A[Codex file-change event] --> B[Transcript tool call]
B --> C[Control UI patch parser]
C --> D[Activity view model]
D --> E[Activity row verb]
D --> F[Work-group summary]
Loading

Decision needed

Question Recommendation
Can a maintainer with the required sibling Codex checkout verify that the cited app-server file-change contract still serializes add, delete, and update operations before this UI repair merges? Verify the contract locally: Inspect the cited Codex protocol source in a permitted sibling checkout and proceed if it confirms the three operation variants.

Why: Repository policy requires direct sibling-source inspection for this Codex-dependent claim, which this read-only environment cannot perform because ../codex is absent and network access is unavailable.

Before merge

  • Resolve merge risk (P2) - The repair adds 59 net production lines for a bug fix; the added operation states and localized strings appear necessary, but final review should retain the single parser-to-view-model path rather than introduce a parallel operation classifier.
  • Resolve merge risk (P1) - The PR’s stated Codex protocol dependency could not be directly inspected because the required sibling checkout is unavailable; a maintainer with that checkout should verify the cited add/delete/update contract before merge.
  • Complete next step (P2) - Wait for exact-head CI, then have a maintainer with the required Codex checkout confirm the upstream operation contract; no mechanical repair is identified.
Agent review details

Security

None.

PR surface

Source +59, Tests +187. Total +246 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 5 141 82 +59
Tests 4 191 4 +187
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 332 86 +246

Review metrics

Metric Value Why it matters
Production versus test LOC production +141/-82 (net +59); tests +191/-4 (net +187) The production growth carries operation facts and new visible verb states; the tests cover parser, row, grouping, and browser-flow behavior.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #122267
Summary: This PR is the focused candidate fix for the linked Control UI operation-labeling defect.

Members:

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the parser as the sole source of operation metadata and merge only after direct upstream-contract verification; no net-neutral alternative is evident because accurate create/delete/mixed states require new presentation keys while the grouping refactor already removes the previous duplicated counters.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the parser as the sole source of operation metadata and merge only after direct upstream-contract verification; no net-neutral alternative is evident because accurate create/delete/mixed states require new presentation keys while the grouping refactor already removes the previous duplicated counters.

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

Yes—source inspection shows that current main receives structured add/delete/update facts but flattens parsed patches to the edit presentation kind; the supplied browser scenario targets that exact path.

Is this the best way to solve the issue?

Yes, subject to direct Codex-contract confirmation: preserving the producer-recorded operation through the existing patch view model is narrower and more maintainable than changing the projector or inferring operations in the renderer.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: The PR repairs bounded but operator-visible Control UI activity accuracy without affecting transport, storage, or provider execution.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR nevertheless includes before/after UI screenshots and a browser scenario.

Label justifications:

  • P2: The PR repairs bounded but operator-visible Control UI activity accuracy without affecting transport, storage, or provider execution.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR nevertheless includes before/after UI screenshots and a browser scenario.

Evidence

What I checked:

  • Current-main defect: Current Control UI parsing recognizes patch sections but resolvePatchView assigns every parsed patch the presentation kind edit, so a structured add loses its authoritative operation before row rendering. (ui/src/lib/chat/tool-call-view.ts:221, bc030544ee7e)
  • Authoritative producer fact: The Codex app-server projector carries each file-change kind and path into transcript arguments, and its regression test covers update, add, and delete records. (extensions/codex/src/app-server/event-projector-tool-items.ts:263, bc030544ee7e)
  • Branch repair and coverage: The branch adds operation metadata to the parsed patch view, derives row verbs from it, and exercises mixed add/update/delete activity in a browser scenario plus focused unit tests. (ui/src/lib/chat/tool-call-grouping.ts:35, f9e14495d673)
  • Feature provenance: Blame ties the current all-edits projection and original tool-row verbs to the initial Control UI patch-rendering commit; the reported regression appears to have been carried forward from that implementation. (ui/src/lib/chat/tool-call-view.ts:221, 5179e1235293)
  • Dependency inspection limitation: The PR explicitly relies on the Codex file-change operation contract, but the required sibling ../codex checkout is absent and network access could not retrieve it; supplied PR links were not treated as direct dependency inspection.

Likely related people:

  • Peter Steinberger: Introduced the current Control UI patch parser, view model, grouping, and row-rendering surface that the repair extends. (role: feature introducer and recent area contributor; confidence: high; commits: 5179e1235293; files: ui/src/lib/chat/tool-call-patch.ts, ui/src/lib/chat/tool-call-view.ts, ui/src/lib/chat/tool-call-grouping.ts)

Rank-up moves

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

  • Verify the cited Codex add/delete/update contract from a permitted sibling ../codex checkout 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

Pre-merge review complete for f9e14495d6732ede6875a30744923aa609254e08.

  • No actionable findings remain; sequential branch review passes completed cleanly.
  • ClawSweeper Rank-up move applied: the upstream add/delete/update contract was verified directly at openai/codex@f344a80a3b4a2e9a3f70f04526c77c6a979f5fb4 in codex-rs/app-server-protocol/src/protocol/v2/item.rs:1053-1070 and codex-rs/tui/src/diff_render.rs:428-442.
  • The +59 production LOC concern was reviewed: the operation fact stays on the existing parser-to-view-model path, the grouping owner replaces parallel counters, and the added visible states have no net-neutral alternative.
  • Focused proof: 118 unit tests and the mixed-operation Chromium scenario passed.
  • Exact-head CI: openclaw/ci-gate passed.

Ready for the native landing flow.

@vyctorbrzezowski
vyctorbrzezowski merged commit 285e58e into main Aug 11, 2026
113 of 115 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/control-ui-factrow branch August 11, 2026 22:23
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Landed as 285e58e5efc2c8ea5150807e0e9d735364cd6f6d.

Exact-head CI passed on f9e14495d6732ede6875a30744923aa609254e08: https://github.com/openclaw/openclaw/actions/runs/31540614502

Issue #122267 was closed by the merge.

vincentkoc added a commit that referenced this pull request Aug 11, 2026
* origin/main: (1725 commits)
  fix(agents): preserve reply cleanup when cancellation throws (#122252)
  fix(ui): render disallowed link schemes as plain text (#122311)
  fix(test): isolate gateway helper env stubs (#122319)
  fix(ui): keep chat Markdown block rhythm consistent (#122289)
  test(cli): trim duplicate Hooks process cases (#122278)
  fix(ui): retain identity while agent roster loads
  fix(ui): preserve configured agent labels
  fix(plugins): keep startup convergence read-only (#122330)
  fix: preserve WebChat reply context after reloads (#122169)
  fix(ui): make DONE moves visibly reversible (#122303)
  fix(ui): keep inline-code punctuation attached (#122291)
  fix(google-meet): publish exports atomically (#122306)
  fix(channels): preserve failed agent run reactions (#122009)
  fix(ui): label patch file operations accurately (#122287)
  fix(windows): preserve Unicode LAN route aliases (#122263)
  test(media): synchronize transcode pool completion (#122279)
  fix(android): keep completed subagent activity visible for sixty seconds (#122089)
  fix(ui): humanize bare GitHub item links (#122285)
  refactor(qqbot): install plugin from Tencent package (#107295)
  chore: scope SQLite session lifecycle CI (#121917)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 12, 2026
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 P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

fix(ui): label created files accurately in tool activity

1 participant