Skip to content

fix(ui): retire suggestions when prediction eligibility changes - #178603

Merged
steipete merged 1 commit into
mainfrom
solid2/w-zero-prediction
Oct 20, 2026
Merged

steipete merged 1 commit into
mainfrom
solid2/w-zero-prediction

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

A prediction can remain visible when its reactive eligibility changes without a general composer props refresh. The effect tracked the outer predictions object, then read its current fields only in the untracked apply phase.

User Impact

Changing prediction eligibility now retires the suggestion and event subscription immediately. Acceptance, cancellation, visibility, and late-result checks still use current owner facts.

Why This Change Was Made

Prepare the complete prediction source in the effect's tracked compute phase and pass it to the existing sync(next) operation. Native event callbacks still read live input at the point of use. No new owner, cache, option, import, or lazy boundary is introduced.

This completes the prediction-input finding from the survivor audit in #178593. The effect remains because it synchronizes real dictation, catalog, and prediction resources; menu resets also retire real resources and are not replaced by speculative rendering state.

Evidence

Proof Result
New reactive-eligibility regression on original production files Fails: suggestion remains visible after eligibility changes
chat-composer-prediction.test.tsx --maxWorkers=1 17 passed; 2.73 s Vitest, 5.22 s wrapper
pnpm tsgo:ui Passed
Targeted formatting and git diff --check Passed
Independent P0–P2 review No actionable findings
Effect / untrack / raw listener / query counts Unchanged

Production LOC 349 → 351 (+2); test LOC 177 → 194 (+17). The new test exercises the actual composer and a reactive field update without a props refresh. One initial fixture attempt failed because the whole composer was incorrectly mounted under a primitive owner; the fixture was corrected and the complete focused file passed. Existing unrelated strict-read warnings remain in adjacent question/menu code.

No visual structure/style or startup import graph changes; no local build/E2E suite under the campaign budget. ci:full supplies the broad Chat, retention, and browser proof. No leases used.

Prepare the full prediction source in the effect compute phase. Keep event and async admission checks live, while allowing a reactive eligibility change to retire the visible suggestion and subscription without a broad props refresh.
@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 20, 2026
@clawsweeper

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 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-20T17:52:01.565282Z efe08e9 PR opened
ℹ️ 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.

@steipete
steipete enabled auto-merge (squash) October 20, 2026 17:34
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment 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-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR tracks prediction eligibility fields so suggestions retire when eligibility changes without a composer props refresh.

Example: The composer shows “Show me the smaller implementation first.” and reactive prediction eligibility changes from active=true to active=false.

  • Before: The suggestion can remain visible until another composer refresh.
  • After: The suggestion disappears and the prediction subscription is retired.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A useful, minimal repair with a meaningful reported red/green regression; behavioral evidence is limited to an in-process composer harness.
Proof confidence 🦐 gold shrimp (3/6) The maintainer-authored PR is outside the ordinary contributor proof gate; supplied validation exercises the production composer in jsdom with synthetic Gateway events rather than a shipped browser entry point.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An optional follow-up suggestion can remain visible after reactive composer eligibility becomes false.
Reason: The focused change restores the existing discard contract, and the maintainer-authored direction is already established.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR repairs a prediction lifecycle defect still present on current main. The change is focused, and no actionable introduced bug was found.

Priority: P2
Reviewed head: efe08e9ea410213fc9b5d0113cfa74966991f2bc

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No supplied browser evidence exercises a visible prediction becoming ineligible without a general props refresh.
Agent review details

How this fits together

The Control UI composer consumes session, draft, and eligibility facts, subscribes to Gateway completion events, and presents optional follow-up text that users can accept into their draft.

flowchart LR
  A[Session and draft facts] --> B[Tracked prediction source]
  B --> C[Prediction owner]
  D[Gateway completion events] --> C
  C --> E[Optional suggestion]
  E --> F[User draft]
Loading

Technical review

Best possible solution:

Prepare eligibility in the existing effect’s tracked phase and pass it to the existing prediction owner while keeping event, acceptance, and async-result checks live.

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

Source shows nested eligibility being read only during untracked effect application on current main; the committed regression isolates that dependency change, and the PR reports the expected base failure and head pass.

Is this the best way to solve the issue?

This is the smallest complete repair using existing owners: all sync callers are migrated, no parallel state is introduced, and the added test catches a distinct reactive invalidation failure.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Prediction owner and cancellation lifecycle keeps the original intent (3ca8c08: Move class-owned suggestion presentation into Solid stores while preserving keyboard acceptance, undo, and stale-result cancellation.)
  • Composer resource reconciliation effect keeps the original intent (2fc8899: Consolidate composer lifecycle synchronization while retaining real dictation, catalog, and prediction resources.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • RoboClaw: Raw commit aeeb4e8 adds ui/src/pages/chat/components/chat-composer.tsx:61 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: aeeb4e813c15; files: ui/src/pages/chat/components/chat-composer.tsx)

PR surface

Source +2, Tests +17. Total +19 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 11 9 +2
Tests 1 18 1 +17
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 29 10 +19

Labels

Label changes:

  • add P2: A limited presentation and subscription lifecycle bug affects the optional composer prediction experiment.
  • 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: A limited presentation and subscription lifecycle bug affects the optional composer prediction experiment.
  • 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 browser behavior showing an existing suggestion disappearing when composer eligibility changes without a props refresh.

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 20, 2026, 1:42 PM ET / 17:42 UTC.

@steipete
steipete merged commit 0478927 into main Oct 20, 2026
100 of 101 checks passed
@steipete
steipete deleted the solid2/w-zero-prediction branch October 20, 2026 17:44
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
…78603)

Prepare the full prediction source in the effect compute phase. Keep event and async admission checks live, while allowing a reactive eligibility change to retire the visible suggestion and subscription without a broad props refresh.
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 ci:full Keep ordinary native-locale CI selection on the next PR run. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS 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