Repository navigation
perf(ui): reuse complete session event descriptors - #178064
Conversation
|
🦞👀 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ab5bdb0d8
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex review: needs changes before merge. What this changesThis PR updates cached session descriptors from complete Gateway events instead of requesting the same details again. Example: Reopen agent:main:describe-test after each of 11 complete session updates.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 2 items remain This PR is a useful, maintainer-directed optimization, but descriptor reuse can retain a cleared message preview and the browser probe can falsely certify presentation correctness. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Control UI's connection-scoped descriptor owner receives Gateway responses and session events, then supplies session details to navigation and resource consumers. flowchart TD
A[Gateway row presenter] --> B[Descriptor response]
A --> C[Complete session event]
B --> D[Connection descriptor owner]
C --> E[Shared row reconciler]
E --> D
D --> F[Session navigation and Details]
Technical reviewBest possible solution: Keep reuse in the existing descriptor owner, honor authoritative preview removal, and make the browser probe verify the actual rendered surfaces. Do we have a high-confidence way to reproduce the issue? Current-main source invalidates matching descriptors even after complete events; the PR reports a focused base-versus-head reproduction, which was inspected but not executed during this read-only review. Is this the best way to solve the issue? Updating the existing connection owner is the smallest appropriate approach, provided descriptor completeness does not inherit the roster's intentional preservation of omitted enrichment. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2d7ba4ef7e39. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +30, Tests +56, Docs +7, Other +51. Total +144 across 5 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
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:10 AM ET / 05:10 UTC. |
998d7dc to
6095796
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 60957964b1
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Keep completed descriptor reads current from certified session event snapshots instead of discarding details already delivered by the Gateway. Preserve incomplete-event refreshes, connection ownership, previews, and runtime samples. Extend the browser probe to attribute descriptor traffic and compare Details with server state.
6095796 to
07db211
Compare
|
@clawsweeper re-review The complete-event preview omission and rendered-proof findings are fixed. Full events now clear omitted previews, and the probe separately verifies Details input state, the model rendered inside Details, and the label rendered in the conversation header. The later run-reactivation finding is also fixed: equal accumulated runtime only retains its timestamp while run identity and status remain unchanged. All 29 descriptor tests pass, including regressions that failed before those corrections. Independent review and the GitHub review of |
|
🦞👀 Re-review progress:
|
* perf(ui): reuse complete session event descriptors Keep completed descriptor reads current from certified session event snapshots instead of discarding details already delivered by the Gateway. Preserve incomplete-event refreshes, connection ownership, previews, and runtime samples. Extend the browser probe to attribute descriptor traffic and compare Details with server state. * test(perf): scope descriptor label proof to the conversation header * fix(ui): clear omitted previews in cached session descriptors * fix(ui): resample cached runtime when session runs change
What Problem This Solves
Reopening a recently updated session repeats
sessions.describeeven when the Control UI already received its complete, current details in a session event.User Impact
Session navigation reuses current details without a redundant request. Incomplete updates, session replacements, explicit refreshes, subscription outages, and reconnects still require authoritative reads.
Why This Change Was Made
The existing connection-owned descriptor cache discarded every matching event. It now advances completed entries from certified, complete same-incarnation events through the existing row reconciler. Pending requests still coalesce, and retention remains bounded. There is no new cache, timer, configuration, or wire contract.
Full events clear omitted previews rather than preserving stale roster enrichment. Runtime samples are retained only while accumulated runtime, status, and run identity agree, so reactivated runs do not count idle time. Production cache code grows by 40 lines (64 added, 24 removed) to preserve completeness, request options, and runtime semantics; incomplete events still require invalidation.
Evidence
Acceptance rule recorded before measurements: concurrent baseline/candidate runs with identical synthetic sessions, separate state/ports, matching start time, and swapped 16-core halves in at least two pairs; target at least 80% fewer activity-window describes, correct Details, and no material responsiveness regression.
Both completed pairs cut describe requests by 96–97%. Each used a real source Gateway, production-minified Control UI, native Chromium 156, 5,000 synthetic sessions, and 30 alternating navigation/label-patch actions over 60 seconds. An exclusive measurement lock covered each concurrent pair. Pair 1 used A on CPUs 96–111 and B on 112–127; pair 2 swapped them. Startup and final controller verification were outside the activity window. Calls/minute were 30.996 → 1.000 and 29.995 → 1.000, respectively.
All four browser runs had zero page errors and passed the final Details input comparison against a fresh server descriptor, rendered-model check inside Details, and rendered-label check in the conversation header. Revisit statistics consistently exclude the first visit to each of the two sessions (28 remaining actions per side).
The full-action p95 increase in pair 2 is retained above. It came from the first visit to session 2, before the changed event-reuse path executed: the action ended at 33,374.8/33,632.3 ms, while the first recorded
sessions.changedarrived at 33,394.7/33,686.1 ms. The probe does not recordsession.message; source and fixture inspection establishes that label patches/navigation do not produce transcript messages, subscription does not replay them, and the isolated fixture has no active runs, plugins, channels, cron, or heartbeat producing messages. Pre-tail descriptor request keys match, and that cold read's RTT was 60.1 → 62.1 ms. Initial cache misses and runtime sampling retain their prior behavior. This excludes event reuse from the cold outlier; it does not fully diagnose the extra 190 ms or claim a cold-latency improvement. Both sides also had an earlier roughly 3.7-second first patch, with roughly 3.5 seconds in the unchanged Gateway commit phase. Warm revisit p95 was 72 → 72 ms and 75 → 80 ms. No material warm-path regression was observed.CPU busy context, including workload plus outside load, averaged 2.32%/1.95% across the two halves in pair 1 and 3.30%/3.27% in pair 2. Baseline source:
b8daeb2a95a8a2bdb07d1bd950568a67b85c745d; candidate:07db21160806f5ef08073f139edd1a918766a0c0. The relevant Gateway, event projection, descriptor, and consumer paths did not change between the baseline and final rebase parent. Built candidate descriptor SHA-256:dc0346573c015a1f6a390801e90e9cd267fec5956a0884fb861e835f17e27074; committed probe SHA-256:abd929d444d13f607f23b9b29ffce07a8ac4ea584f270d6323b45c53fb79c889.The committed workload, per isolated side:
Attribution runs found no steady polling in this fixture: a 190-second stationary chat/Details run made three setup reads and none for the remaining approximately 185 seconds; 30 same-session patches over 60 seconds made zero activity-window reads. Source-mapped consumers were sidebar lineage, desktop discovery, and board/swarm parent reads. Avoidable reads followed invalidation plus a later consumer/navigation read. Board startup also showed explicit refreshes after metadata events; those remain necessary for catalog/authentication changes.
Focused proof: the navigation regression fell from 12 RPCs on base to 1 after 11 complete updates/reentries. All 29 descriptor tests passed, including preview-omission and run-reactivation regressions that failed before their fixes; two focused sibling files passed all 23 tests. Changed-file formatting/lint and native
pnpm tsgo:uipassed. Independent Codex review and the GitHub review of the final head are clean. Final CI run 39378853938 passed all 38 executed jobs, including UI, UI E2E, production/test types, lint, and the merge gate. An earlier inherited TS2367 failure was resolved by rebasing onto the upstream fix in #178096; no CI rerun was requested. No Testbox/Crabbox lease was used.Limitations: the workload uses synthetic label updates and navigation, without real provider turns. It does not explain every production descriptor request or verify the eventual production counter reduction. The result establishes request elimination on the measured event/reentry path, not a production-wide 96–97% reduction.