Skip to content

fix(chat): stop composer render feedback loop - #1326

Merged
shanselman merged 1 commit into
mainfrom
shanselman-investigate-dotnet-regression
Sep 4, 2026
Merged

shanselman merged 1 commit into
mainfrom
shanselman-investigate-dotnet-regression

Conversation

@shanselman

Copy link
Copy Markdown
Collaborator

Fixes #1325

Summary

  • move ChatComposerInputs application out of OpenClawReactorChatRoot.Render() and into a dependency-bounded post-commit effect in ReactorChatComposer
  • assign monotonic input revisions from the host-owned ChatComposerSession, so view remounts cannot reset ordering
  • suppress stale and semantically unchanged input notifications while advancing a separate latest-observed revision watermark
  • keep all composer hooks unconditional and synchronize the view-model render token when subscribing
  • update the architecture ledger and add regression coverage for stale/equivalent inputs, every projected field, session remounts, and the closed root boundary

Ownership transfer

  • Old owner: OpenClawReactorChatRoot.Render() imperatively applied composer inputs during render.
  • New owner: ReactorChatComposer applies root-projected immutable inputs in a post-commit effect; ChatComposerSession owns revision sequencing; ChatComposerViewModel owns stale/equivalent admission.
  • Preserved invariant: the root remains the provider subscription/selection/projection owner without regaining composer mutable state, and delayed input work cannot regress the applied projection.

The existing Release-only System.Diagnostics.Debugger.IsSupported=false mitigation for dotnet/runtime#129191 remains unchanged. This repair removes the application feedback loop that amplified that independent runtime retention regression.

Required proof pools

  • windows-winui-interactive: native chat mount, responsiveness, and live composer UIA layout

Validation

  • ./build.ps1
    • all repository builds succeeded
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore
    • 3,915 passed, 32 skipped, 0 failed
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore
    • 2,857 passed, 0 skipped, 0 failed
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore --filter "FullyQualifiedName~ChatComposerViewModelTests|FullyQualifiedName~ChatComposerSessionTests|FullyQualifiedName~ChatRootComposerClosureTests"
    • 34 passed, 0 failed
  • dotnet test ./tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj -c Debug -r win-x64 --no-restore --filter "FullyQualifiedName~ChatComposerControls_ExposeOnscreenLayoutThroughUia"
    • 1 passed, 0 failed
  • independent code review and required rubber-duck review
    • no blocking or significant findings after the stale-watermark correction

Real behavior proof

A current-head isolated real WinUI process mounted the native ChatPage through the UI-test fixture. The chat composer became responsive and exposed onscreen, nonzero UIA bounds for ChatComposerInput, ChatComposerAttach, and ChatComposerSpeakerToggle; the proof completed in 953 ms instead of wedging in the Reactor render loop.

The source closure guard also verifies that OpenClawReactorChatRoot contains no ComposerSession.ApplyInputs call and that application occurs only in the composer post-commit effect.

Long-duration CPU/heap soak is not included. The deterministic feedback edges are removed and guarded independently, while the production .NET 10 COM-wrapper mitigation remains active.

Apply immutable composer inputs after Reactor commits instead of mutating the session during Render. Suppress stale and equivalent projections without losing the latest revision watermark.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: bc4eceec-bb07-4efb-8a50-887a7c6d1bac
@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

🦞👀
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 P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. 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 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 4:08 PM ET / 20:08 UTC.

ClawSweeper review

What this changes

The PR moves composer-input application from the chat root’s render path to a dependency-bounded post-commit effect, with session-owned revisions and no-op notification suppression.

Regression provenance

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

Merge readiness

✅ Ready for maintainer review

Keep open. This collaborator PR is a focused repair for the active chat render-loop report, and the reviewed patch removes the render-time mutation without introducing a source-backed correctness or security defect.

Priority: P0
Reviewed head: 70fe5142f23055909b6e9952ffdf19360c92dcf2

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-covered repair with no blocking review finding; the collaborator proof gate is not applicable.
Proof confidence 🌊 off-meta tidepool Not applicable: The PR is collaborator-authored, so contributor proof is not a merge gate; its body nevertheless reports a current-head isolated WinUI fixture mounting ChatPage and observing the composer controls with nonzero UIA bounds.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The PR is collaborator-authored, so contributor proof is not a merge gate; its body nevertheless reports a current-head isolated WinUI fixture mounting ChatPage and observing the composer controls with nonzero UIA bounds.
Evidence reviewed 6 items Repository and introduced-diff check: The verified origin is the target repository. The PR head differs from its current-main base in ten focused chat, test, and architecture files, so current main does not already contain this repair.
Render-side mutation removed: The root now builds an immutable input projection and passes it to the composer rather than applying it during Render.
Post-commit effect is bounded: The composer subscribes once, then applies inputs through an effect keyed by the source snapshot and selected thread. The local Reactor implementation queues changed effects after render and skips equal dependencies.
Findings None None.
Security None None.

How this fits together

The tray chat root projects gateway and conversation state into a composer session. The composer view consumes that projection to render and update chat controls without feeding mutations back into the root render.

flowchart LR
  Provider[Chat data provider] --> Root[Chat root projection]
  Root --> Inputs[Immutable composer inputs]
  Inputs --> Effect[Post-commit composer effect]
  Effect --> Session[Composer session]
  Session --> ViewModel[Composer view model]
  ViewModel --> Controls[Native chat controls]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Implementation and regression delta production +90/-27, tests +136/-5, docs +2/-2 The repair adds more focused regression coverage than production code while updating the ownership ledger.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #1325
Summary: This PR explicitly supplies the candidate repair for the reported chat composer render loop.

Members:

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

Technical review

Best possible solution:

Preserve the root-to-composer ownership split and land this bounded repair once normal checks for the exact head complete.

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

Yes, by source inspection: the base path applied composer inputs during render and unconditionally notified the subscribing composer. The PR body also reports a current-head native WinUI fixture run, though this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. Applying the immutable projection after commit while rejecting stale and equivalent updates breaks the feedback edge without returning composer workflow state to the root.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P0: This PR addresses a reported unbounded chat render loop that can peg CPU, grow memory, and leave the tray unresponsive.
  • 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 PR is collaborator-authored, so contributor proof is not a merge gate; its body nevertheless reports a current-head isolated WinUI fixture mounting ChatPage and observing the composer controls with nonzero UIA bounds.

Label justifications:

  • P0: This PR addresses a reported unbounded chat render loop that can peg CPU, grow memory, and leave the tray unresponsive.
  • 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 PR is collaborator-authored, so contributor proof is not a merge gate; its body nevertheless reports a current-head isolated WinUI fixture mounting ChatPage and observing the composer controls with nonzero UIA bounds.

Evidence

What I checked:

Likely related people:

  • Barbara Kudiess: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Scott Hanselman: 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.

@shanselman
shanselman merged commit 3dcf7ca into main Sep 4, 2026
24 checks passed
@shanselman
shanselman deleted the shanselman-investigate-dotnet-regression branch September 4, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tray pegs one core and grows to 16 GB: unbounded render loop in Reactor chat root (ApplyInputs called during Render)

1 participant