V2: reconcile pending TUI blockers after reconnect #35447
Description
Summary
The V2 TUI can retain stale permission/form blockers or miss newly pending blockers when the SSE event stream disconnects and reconnects.
Current behavior
Pending permissions and session-owned forms are loaded when a session route opens and then maintained from live events. A server.connected event reruns general bootstrap work, but the active route does not remount and its pending blocker lists are not reconciled from HTTP.
Failure modes
- A permission or form created while SSE is disconnected is never added to local TUI state. The session can remain blocked on input the user cannot see.
- A visible permission or form settled elsewhere while SSE is disconnected remains in local state. The TUI continues showing a stale blocker and a reply can fail as already settled.
- A naive bootstrap fix that refreshes permissions and forms for every cached session creates
2 * session countrequests, including child or stale sessions, and couples unrelated blocker behavior to general bootstrap.
Expected behavior
After reconnect, blockers relevant to the visible/owned session scope should converge to server state without refreshing every cached session and without overwriting newer live events.
Suggested scope
- Define which active or visible session owners must be reconciled after reconnect.
- Refresh pending permissions and session-owned forms for that owner set.
- Preserve live events that arrive while an HTTP list request is in flight; stale responses must not remove newly created blockers or resurrect settled blockers.
- Cover both missed-create and missed-settlement disconnect scenarios.
- Cover HTTP/live-event ordering and repeated reconnects.
- Keep location-owned global forms explicit rather than treating
"global"as a real session ID.
Notes
QuestionV2 has the same route/event reconciliation gap today, but its TUI path is being replaced by forms. This issue should produce a shared blocker-reconciliation design for permissions and forms rather than patching one feature through global bootstrap.
Activity
opencode-agent commentedon Jul 8, 2026
Audit update (2026-07-08): form rendering landed in #35421, and #35423 is the active V2 fix for location-scoped global forms. The reconnect reconciliation described here remains the acceptance boundary; keep open until pending permission/form state is verified to converge after reconnect.
thdxr commentedon Jul 9, 2026
Closing this tracker after the recent V2 server lifecycle, restart continuity, reconnect hydration, and synchronization work. This area has changed substantially, and we want to track any remaining or newly reproducible behavior as a fresh, focused issue against the current implementation.