Repository navigation
fix(app): recover child session permissions after reconnect - #65120
Conversation
There was a problem hiding this comment.
The fix works. With the PR's new e2e test run against the base branch, the child session's pending permission never shows up after load: no permission dock, and the test fails at its first check. With this PR the dock appears, and all of session-request-docks.spec.ts passes (12/12). typecheck:tsc in packages/app passes too.
The tab-strip and inbox changes follow the same rule: fetch requests for the open session, running sessions in the tree, and sessions that still have cached requests. Idle subagents stay unfetched, and the test checks that.
Public API is unchanged; this only touches app-internal client code.
No blocking concerns.
d2ec051 to
08ad347
Compare
There was a problem hiding this comment.
The new commit only moves the "running, or still has cached requests" check into one shared sessionMayHoldRequests helper used by the model, tab-strip and inbox. Which sessions get fetched is unchanged, and the test edit is a small cleanup. On the new head, typecheck:tsc passes and session-request-docks.spec.ts passes 12/12.
Public API is unchanged. No new concerns.


Issue for this PR
Fixes #65086
Type of change
What does this PR do?
createSessionRequestModelonly synced pending permissions for the currently open session (params.id), while forms already synced every running session in the session tree. Sincepermission.asked/permission.repliedare ephemeral events and the server's per-session permission endpoint matches exact session IDs, a child/subagent's pending permission was never fetched after a page reload or SSE reconnect—even thoughsessionPermissionRequestwalks the whole tree.Changes (building on @pavlovma007's report and fix idea):
packages/app/src/session/requests/model.ts: RenameformSessionstorequestSessionsand sync both permissions and forms for the open session, running sessions in its tree, and any tree sessions that currently hold cached permissions or forms (so reconnects also clear requests resolved while offline without polling idle subagents).packages/app/src/shell/titlebar/tab-strip.tsx&packages/app/src/shell/titlebar/inbox-model.ts: Apply the same family-scoped sync for inactive session tabs and inbox settle checks instead of syncing only the root session ID.packages/app/e2e/regression/session-request-docks.spec.ts: Add a regression test covering initial load recovery, stale permission clearing when a child finishes while offline, reconnect recovery withoutpermission.asked, replying to the child session, and verifying idle subagents are not polled.How did you verify your code works?
model.tsfix (dock-prompt[data-kind="permission"]not found).e2e/regression/session-request-docks.spec.tsin built mode (12/12passed, includingPLAYWRIGHT_FULLY_PARALLEL=1 --workers=5 --retries=0and--repeat-each=10 --workers=5 --retries=0on the new test).bun run testinpackages/app(2842unit +378browser tests passed).bun run lint:changed,bun run typecheck:tscinpackages/app, andbun run checkfrom repo root.Screenshots / recordings
N/A (no visual styling change).
Checklist