Repository navigation
fix(ui): retire suggestions when prediction eligibility changes - #178603
Conversation
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.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis 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.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +2, Tests +17. Total +19 across 3 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 20, 2026, 1:42 PM ET / 17:42 UTC. |
|
Merged via squash auto-merge.
|
…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.
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
chat-composer-prediction.test.tsx --maxWorkers=1pnpm tsgo:uigit diff --checkProduction 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:fullsupplies the broad Chat, retention, and browser proof. No leases used.