From 502e236de5941dcabafe25d6df016668b05a8a57 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Tue, 13 Oct 2026 01:04:48 -0700 Subject: [PATCH] test(gateway): the Desktop metadata probe reads pending/running only from the queue snapshot 3429015b2a9 made a local viewer's turn end republish the banner inventory as `session.info` (main's _emit_settled_session_info), like the title and reasoning republishes already do. Those frames carry no `pending`/`running`/`execution_generation`: they are not the owner's queue snapshot (`SessionAuthority._publish_pending`), and Desktop's lease and execution-fence code ignores them for the same reason (gateway.ts reads `running === true/false`, execution-authority.ts requires a numeric execution_generation). The probe skipped nothing and hit KeyError 'pending' on PR CI 38364468727; it now skips frames without the snapshot keys and still requires the snapshot to show the turn queued, then settled. --- tests/gateway/test_canonical_desktop_metadata.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/gateway/test_canonical_desktop_metadata.py b/tests/gateway/test_canonical_desktop_metadata.py index 9101a7bd7e..ec1cf82887 100644 --- a/tests/gateway/test_canonical_desktop_metadata.py +++ b/tests/gateway/test_canonical_desktop_metadata.py @@ -44,6 +44,10 @@ def test_canonical_desktop_metadata_survives_create_info_and_reattach(tmp_path): info = event['payload'] assert info['desktop_protocol'] == creator.subprotocol assert 'desktop_contract' not in info + if 'pending' not in info: + # The banner/inventory republish (turn end, title, reasoning) is not the + # owner's queue snapshot; Desktop's lease/fence logic ignores it too. + continue saw_pending |= bool(info['pending']) finished = saw_pending and not info['pending'] and not info['running'] await settled(home)