fix(cli): prevent desktop session transcript bleed from unscoped events - #49659
fix(cli): prevent desktop session transcript bleed from unscoped events#49659konsisumer wants to merge 1 commit into
Conversation
|
Related: #47743 (resolve-session-id refactor across desktop hooks), #48281 (pin unscoped stream events to their originating session), #42359 (merged: don't drop the focused chat's own unscoped stream), #49106 (the open issue this fixes). These are three open competing approaches to the same cross-session transcript-bleed symptom in |
|
Thanks for the analysis. I verified locally that current main already includes |
What does this PR do?
Stops the desktop renderer from attributing unscoped turn events to whichever chat is currently focused. Desktop now treats transcript-mutating and prompt-blocking gateway events as malformed unless they include
session_id, which prevents live turns from another session/window from bleeding into the visible transcript. The backend already stamps these per-session events explicitly, so tightening the client-side routing matches the current transport contract.Related Issue
Fixes #49106
Type of Change
Changes Made
apps/desktop/src/lib/gateway-events.ts: requiresession_idfor session-scoped desktop gateway events (message.*,reasoning.*,tool.*, prompt requests, status/review events) while keeping truly global events unscoped.apps/desktop/src/lib/gateway-events.test.ts: update regression coverage to assert that unscoped session-scoped events are dropped instead of being attached to the focused chat.How to Test
session_id; malformed unscoped turn events are ignored instead of appearing in the focused transcript."$VIRTUAL_ENV/bin/python" scripts/check-windows-footguns.py --diff HEAD~1git diff --check HEAD~1..HEAD/opt/homebrew/bin/timeout -k 30 480 sh -c '"$VIRTUAL_ENV/bin/pytest" tests/ -q -x --timeout=60 "$@"' shcurrently stops early on unrelated pre-existing failuretests/acp/test_approval_isolation.py::TestAcpExecAskGate::test_interactive_env_var_routes_to_callbacknode_modulesare not installedWhat platforms tested on
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A