Repository navigation
fix(desktop): refresh multiplexed profile transcripts - #99333
StodsEcho5 wants to merge 1 commit into
Conversation
Heartbeat diagnosticThis PR shows The Recommendation: maintainers can merge when ready — no rebase or conflict resolution needed. Tests are included and pass on the PR branch. |
…9333) Two sites dropped profile ownership on the tile-transcript refresh path: - tui_gateway/server.py _sessions_sig statted only the launch home's state.db, so a turn landing in a served sibling profile's store never produced sessions.changed. The watcher now also probes every profile home _profile_home() has resolved for this backend (empty set on single-profile installs — behavior byte-identical there). - use-background-sync.ts reconcileTileTranscripts read the tile's transcript unscoped; it now passes the tile's ownerRoute scope, the same way reconcileActiveTranscript already does for the main pane, and keys the change signature by owner. Reimplemented minimal from PR #99333 (the PR head's commit identity does not match the GitHub author). Co-authored-by: StodsEcho5 <250208229+StodsEcho5@users.noreply.github.com>
Salvages the client half of PR #99333. A workspace tile pinned to an exact owner (connection + target profile) was reconciled via a bare getLatestSessionMessages(storedId) — the foreground profile's backend — so a bot tile on another profile never saw its new turns (or saw the wrong session's). reconcileTileTranscripts now derives a ProfileScope from tile.ownerRoute and keys the per-tile signature by that route; route-less tiles keep the legacy local read. The tui_gateway/server.py `_sessions_sig` cross-profile scan from #99333 is intentionally not taken: the desktop runs one backend per profile, each with its own watcher, so scanning sibling profiles would misattribute ticks. Co-authored-by: stods21 <stods21@users.noreply.github.com>
|
Thanks — this landed on main via #101214 (6d061ed) with your commit/credit preserved. Only the client half was taken: the desktop runs one backend per profile, each with its own watcher, so the server-side cross-profile signature scan would have misattributed ticks. You are co-authored on the commit. Closing the original in favor of the merged salvage. |
…9333) Two sites dropped profile ownership on the tile-transcript refresh path: - tui_gateway/server.py _sessions_sig statted only the launch home's state.db, so a turn landing in a served sibling profile's store never produced sessions.changed. The watcher now also probes every profile home _profile_home() has resolved for this backend (empty set on single-profile installs — behavior byte-identical there). - use-background-sync.ts reconcileTileTranscripts read the tile's transcript unscoped; it now passes the tile's ownerRoute scope, the same way reconcileActiveTranscript already does for the main pane, and keys the change signature by owner. Reimplemented minimal from PR #99333 (the PR head's commit identity does not match the GitHub author). Co-authored-by: StodsEcho5 <250208229+StodsEcho5@users.noreply.github.com>
…9333) Two sites dropped profile ownership on the tile-transcript refresh path: - tui_gateway/server.py _sessions_sig statted only the launch home's state.db, so a turn landing in a served sibling profile's store never produced sessions.changed. The watcher now also probes every profile home _profile_home() has resolved for this backend (empty set on single-profile installs — behavior byte-identical there). - use-background-sync.ts reconcileTileTranscripts read the tile's transcript unscoped; it now passes the tile's ownerRoute scope, the same way reconcileActiveTranscript already does for the main pane, and keys the change signature by owner. Reimplemented minimal from PR #99333 (the PR head's commit identity does not match the GitHub author). Co-authored-by: StodsEcho5 <250208229+StodsEcho5@users.noreply.github.com>
…9333) Two sites dropped profile ownership on the tile-transcript refresh path: - tui_gateway/server.py _sessions_sig statted only the launch home's state.db, so a turn landing in a served sibling profile's store never produced sessions.changed. The watcher now also probes every profile home _profile_home() has resolved for this backend (empty set on single-profile installs — behavior byte-identical there). - use-background-sync.ts reconcileTileTranscripts read the tile's transcript unscoped; it now passes the tile's ownerRoute scope, the same way reconcileActiveTranscript already does for the main pane, and keys the change signature by owner. Reimplemented minimal from PR #99333 (the PR head's commit identity does not match the GitHub author). Co-authored-by: StodsEcho5 <250208229+StodsEcho5@users.noreply.github.com>
…9333) Two sites dropped profile ownership on the tile-transcript refresh path: - tui_gateway/server.py _sessions_sig statted only the launch home's state.db, so a turn landing in a served sibling profile's store never produced sessions.changed. The watcher now also probes every profile home _profile_home() has resolved for this backend (empty set on single-profile installs — behavior byte-identical there). - use-background-sync.ts reconcileTileTranscripts read the tile's transcript unscoped; it now passes the tile's ownerRoute scope, the same way reconcileActiveTranscript already does for the main pane, and keys the change signature by owner. Reimplemented minimal from PR #99333 (the PR head's commit identity does not match the GitHub author). Co-authored-by: StodsEcho5 <250208229+StodsEcho5@users.noreply.github.com>
…9333) Two sites dropped profile ownership on the tile-transcript refresh path: - tui_gateway/server.py _sessions_sig statted only the launch home's state.db, so a turn landing in a served sibling profile's store never produced sessions.changed. The watcher now also probes every profile home _profile_home() has resolved for this backend (empty set on single-profile installs — behavior byte-identical there). - use-background-sync.ts reconcileTileTranscripts read the tile's transcript unscoped; it now passes the tile's ownerRoute scope, the same way reconcileActiveTranscript already does for the main pane, and keys the change signature by owner. Reimplemented minimal from PR #99333 (the PR head's commit identity does not match the GitHub author). Co-authored-by: StodsEcho5 <250208229+StodsEcho5@users.noreply.github.com>
Salvages the client half of PR NousResearch#99333. A workspace tile pinned to an exact owner (connection + target profile) was reconciled via a bare getLatestSessionMessages(storedId) — the foreground profile's backend — so a bot tile on another profile never saw its new turns (or saw the wrong session's). reconcileTileTranscripts now derives a ProfileScope from tile.ownerRoute and keys the per-tile signature by that route; route-less tiles keep the legacy local read. The tui_gateway/server.py `_sessions_sig` cross-profile scan from NousResearch#99333 is intentionally not taken: the desktop runs one backend per profile, each with its own watcher, so scanning sibling profiles would misattribute ticks. Co-authored-by: stods21 <stods21@users.noreply.github.com>
…usResearch#99333) Two sites dropped profile ownership on the tile-transcript refresh path: - tui_gateway/server.py _sessions_sig statted only the launch home's state.db, so a turn landing in a served sibling profile's store never produced sessions.changed. The watcher now also probes every profile home _profile_home() has resolved for this backend (empty set on single-profile installs — behavior byte-identical there). - use-background-sync.ts reconcileTileTranscripts read the tile's transcript unscoped; it now passes the tile's ownerRoute scope, the same way reconcileActiveTranscript already does for the main pane, and keys the change signature by owner. Reimplemented minimal from PR NousResearch#99333 (the PR head's commit identity does not match the GitHub author). Co-authored-by: StodsEcho5 <250208229+StodsEcho5@users.noreply.github.com>
Rematerialize NousResearch#100758 on main f58fcc8, retaining the tested source-first composition of NousResearch#101057 and the declarative roster from NousResearch#102195, together with durable leases, publication fencing, chain-qualified compression recovery, repeated-step identities and strict configuration policy. Original development history: 924fce6, retained in backup/pr100758-before-landing-20260905. Source-authority contribution: NousResearch#101057 at 8355ab1. Declarative roster contribution: NousResearch#102195 at 2215b6e. The NousResearch#99333 client salvage and StodsEcho5 credit remain inherited from main via NousResearch#101214. Validated with scripts/run_tests.sh: 906 passed, 0 failed, 9 skipped across 43 files; retries disabled. Ruff 0.16.4 passed for all changed Python files. Hosted verification must reference this new commit, not earlier tips. Co-authored-by: Brooklyn Nicholson <brooklyn.bb.nicholson@gmail.com> Co-authored-by: Ahmett101 <ahmet.tunc@gmail.com>
…usResearch#99333) Two sites dropped profile ownership on the tile-transcript refresh path: - tui_gateway/server.py _sessions_sig statted only the launch home's state.db, so a turn landing in a served sibling profile's store never produced sessions.changed. The watcher now also probes every profile home _profile_home() has resolved for this backend (empty set on single-profile installs — behavior byte-identical there). - use-background-sync.ts reconcileTileTranscripts read the tile's transcript unscoped; it now passes the tile's ownerRoute scope, the same way reconcileActiveTranscript already does for the main pane, and keys the change signature by owner. Reimplemented minimal from PR NousResearch#99333 (the PR head's commit identity does not match the GitHub author). Co-authored-by: StodsEcho5 <250208229+StodsEcho5@users.noreply.github.com>
fix(desktop): refresh multiplexed profile transcripts
Summary
In a multiplexed gateway, each profile writes to its own session database. The Desktop change watcher only inspected the active profile, so turns written to sibling profiles did not emit
sessions.changed. When another event did trigger tile reconciliation, the transcript read omitted the tile's owner route and could query the wrong profile.The change signature now resolves the shared profiles directory from both root-home and named-profile launches, includes active and named-profile session stores, and ignores symlinked profile directories. Open-tile transcript reads use the tile's connection and target profile. A tile-local busy or awaiting submit is skipped before the read and rechecked after it, preserving optimistic prompts; a completion is also discarded if the tile closes or changes owner while the read is in flight. Tile transcript signatures are keyed by durable ID, runtime ID and complete owner route, with closed-tile entries pruned on each pass. Existing durable-session rebind and canonical tile identity remain unchanged and are included in the regression suite.
Relationship to open work
PR #97887 handles visible-session recovery after a stale runtime RPC. This patch does not modify or duplicate those files; it fixes the two producer paths that leave a multiplexed profile's open transcript stale. A local integration branch combining both commits was tested separately.
Tests
scripts/run_tests.sh tests/desktop/test_multiplex_sessions_change_watcher.pyscripts/run_tests.sh tests/desktop/test_bots_chat_live_append.pynpm --workspace apps/desktop run test:ui -- use-background-sync.test.ts session-states.test.ts session-tile-actions.test.ts use-prompt-actions/utils.test.ts enter-submit-dom-race.test.tsx agent-init-error.test.tsxnpm --workspace apps/desktop run test:uinpm --workspace apps/desktop run typechecknpm --workspace apps/desktop exec eslint -- src/app/contrib/hooks/use-background-sync.ts src/app/contrib/hooks/use-background-sync.test.ts src/store/session-states.test.ts