fix(tui): preserve exact background notification owners - #62201
fix(tui): preserve exact background notification owners#62201kevinmanase wants to merge 1 commit into
Conversation
Related: #61719 and this branch share the core UI-session ownership patch; #62201 adds exact live-owner/background-stream coverage. The branch is now substantially behind current |
|
Thanks for covering the exact live-UI-owner path, including delegated child execution and checkpoint/event propagation. Current main still has the reported defect: This overlaps open PR #61719, as noted in the existing maintainer comment, so the two implementations should be compared and one selected rather than merged together. Automated hermes-sweeper review. |
Thanks. I compared the histories directly. I think #62201 is the branch to keep and #61719 can be treated as superseded. |
ecad36e to
8531159
Compare
Background process output and completion notifications were routed by durable session_key alone. Several live UI tabs can share one key, so the gateway delivered them to whichever tab came first in iteration order -- a user could see output from a command they never ran, and the tab that actually started it saw nothing. Track the commissioning UI tab on the process itself: - ProcessSession gains origin_ui_session_id, set at spawn from HERMES_UI_SESSION_ID for every background process (not just notify/watch ones -- live streaming needs the same return address). - Completion and watch_match notifications carry it, and it survives a gateway restart through the checkpoint. - _owner_sid_for_process prefers the recorded origin when that tab is still live, and only then falls back to session_key matching. The fallback now also skips finalized tabs, which would drop the output. Processes with no recorded origin (older checkpoints, CLI sessions) keep the previous key-matching behavior. The ownership-routing and delegation-context portions of the original branch landed upstream in NousResearch#65419, so this is the remaining delta rebuilt on current main.
8531159 to
2904730
Compare
|
@teknium1 rebased on current main and resolved. The branch was ~7,500 commits behind, so this needed a rework rather than a straight rebase. On the #61719 overlap you raised. Checking against current main, #65419 already landed the ownership routing, and main also solved the delegated-child ContextVar problem a different (better) way, with The defect is still live on main. Two concrete gaps:
Net effect: a user can see output from a command they never ran, while the tab that actually ran it shows nothing. The fix. Track the commissioning tab on the process itself, carry it on completion and
Verification.
One thing to note if you run the suites in bulk: Ready for review. |
fix(tui): preserve exact background notification owners
|
Summary
Background completion and watch notifications now stay bound to the exact live UI session that started them, so output from one chat cannot surface in another chat that shares the same durable conversation identity. The ownership model distinguishes concurrent runtime sessions, preserves the originating stream owner through completion, and keeps terminal/watch attribution scoped to that owner.
Validation
scripts/run_tests.sh tests/test_tui_gateway_server.py tests/tools/test_notify_on_complete.py tests/tools/test_process_registry.py tests/tools/test_terminal_task_cwd.py tests/tools/test_watch_patterns.py tests/tools/test_zombie_process_cleanup.py tests/tui_gateway/test_delegation_session_lifecycle.py— 549 passed, 0 failed.main— no findings.NousResearch/hermes-agentis not connected to Greptile.Related
Related: #61719