Repository navigation
fix: refresh pending approvals when reopening chat - #139457
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: needs maintainer review before merge. Reviewed September 5, 2026, 6:29 PM ET / 22:29 UTC. ClawSweeper reviewWhat this changesRefresh pending approvals whenever another chat pane subscribes, while sharing concurrent requests and preserving existing subscriptions after a timeout. Merge readiness✅ Ready for maintainer review The fix remains necessary: fetched main and v2026.9.2 retain stale approval replays. The patch addresses the shared subscription owner, and no blocking correctness defect was found. Priority: P2 Review scores
Verification
How this fits togetherChat panes and sidebar observers share session subscriptions on one Gateway connection. The coordinator obtains pending approval snapshots from the Gateway and supplies them to newly opened panes. flowchart LR
A[Chat pane opens] --> C[Shared subscription coordinator]
B[Existing sidebar and panes] --> C
C --> D{Replay request pending?}
D -->|Yes| E[Share pending request]
D -->|No| F[Gateway checks access and reads pending approvals]
E --> G[Populate chat approval queue]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -5, Tests +96. Total +91 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep replay freshness in the shared coordinator, with in-flight deduplication and Gateway-authorized recovery, without adding pane-specific caches or configuration. Do we have a high-confidence way to reproduce the issue? Yes: retain a sidebar subscription, change the pending approvals, then reopen the chat pane; current main returns the cached replay. Source proves this path, and the PR reports before/after browser reproduction; this review did not execute it. Is this the best way to solve the issue? Yes: removing the lifetime snapshot cache at the shared owner fixes all later approval acquisitions; forcing pane-level unsubscribe would interfere with other observers and duplicate lifecycle policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 40ebdadcafa6. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Ready for native merge at The before/after PNGs in the PR were personally inspected. They show the actual source Control UI in Chromium using the canonical mock Gateway: the sidebar retains the subscription while the chat pane is evicted, and reopening changes from the stale approval to the current pending set. This is client/browser proof, not a full Gateway-server run. The unchanged server authorization and replay owners were inspected. The latest ClawSweeper review has no actionable findings. Production is net −5 lines; tests +96. |
|
Merged via squash.
|
* origin/main: (95 commits) perf(build): avoid unrelated gateway artifact scans (#127757) fix(update): deliver terminal progress after long updates (#139289) fix(ui): show session hover cards for local chat URLs (#139384) perf(ui): reuse unchanged transcript key snapshots (#139400) fix(ui): make subagent sessions view-only (#139381) fix: open agent state on SQLite builds without extensions (#139487) perf(skills): detach cached metadata from source strings (#139478) fix(ui): show primary user in multi-agent profile hero (#136736) perf(sessions): stop decoding the session row four times per SQLite entry patch (#136361) refactor(exec): share package-manager option scans (#139482) fix(ci): authorize frozen mobile release candidates (#139441) fix: avoid session deletion slowdown in large session stores (#139467) perf(gateway): reuse node invocation idle timers (#139354) fix(auth): preserve selected profiles across plugin scopes (#139413) fix(discord): retain voice input until transcription completes (#139484) fix(agents): name Gateway storage failures in run-failure copy (#139409) fix: keep subagent checks responsive in large session stores (#139450) fix(memory): index notes when optional embeddings cannot start (#139463) fix: refresh pending approvals when reopening chat (#139457) fix(tooling): preserve Git hook choices during install (#139461) ...
What Problem This Solves
Fixes an issue where users reopening a chat, or opening the same session in another pane, could see resolved approvals again and miss new pending approvals while the sidebar or another pane kept the session subscribed.
Why This Change Was Made
The shared connection coordinator now deduplicates in-flight replay requests and fetches the current pending set for each later approval viewer. Removing the lifetime replay cache also consolidates canonical response handling. Timeout recovery preserves the approval capability held by existing leases; server authorization and approval storage remain the authorities.
User Impact
Newly opened chat panes show the current approvals. A failed refresh does not interrupt approval updates in an already-open pane.
Evidence
node scripts/run-vitest.mjs packages/gateway-client/src/session-subscriptions.test.ts: 32 passed, covering replay freshness, concurrent ownership, rejection, timeout compensation, release, and connection retirement. Three freshness cases failed on the baseline before the repair.node scripts/check-changed.mjs -- packages/gateway-client/src/session-subscriptions.ts packages/gateway-client/src/session-subscriptions.test.ts: passed.Before: reopening shows the old approval after the pending set changed.
After: reopening fetches and displays the current pending approval.