diff --git a/mobile/rpc-foundation/goldens/aivault-history-scan-association.json b/mobile/rpc-foundation/goldens/aivault-history-scan-association.json index 94eb7c8032c..71b6bdaff77 100644 --- a/mobile/rpc-foundation/goldens/aivault-history-scan-association.json +++ b/mobile/rpc-foundation/goldens/aivault-history-scan-association.json @@ -4,6 +4,11 @@ "family": "aiVault.history", "namedDeltas": [], "values": { + "2182656920b3": { + "name": "aiVault.listSessions#1", + "ordinal": 5, + "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}" + }, "44a27dbf05e2": { "name": "status.get#1", "ordinal": 3, @@ -30,39 +35,7 @@ ] } }, - "7e8b2964ad63": { - "name": "streams-registered-at-teardown", - "ordinal": 8, - "value": [ - { - "cancelled": false, - "method": "agentSession.subscribeStatus", - "payload": "agentSession.subscribeStatus#1" - } - ] - }, - "7f300f2af8fd": { - "name": "aiVault.listSessions#2", - "ordinal": 7, - "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}" - }, - "98ac9d409279": { - "activeWorktreePath": "/repo/feature", - "refreshing": false, - "scope": "workspace", - "screenState": { - "issues": [], - "kind": "ready", - "sessions": [ - { - "agent": "pi", - "cwd": "/repo/feature", - "id": "s1" - } - ] - } - }, - "ad5b1230fc26": { + "69310cf221d2": { "name": "aiVault.listSessions#2", "ordinal": 6, "args": [ @@ -75,6 +48,7 @@ "value": { "force": false, "limit": 500, + "scopeOnly": true, "scopePaths": ["/repo/feature"] } }, @@ -109,10 +83,81 @@ } } }, - "b6a16cc83e18": { + "7a3238411452": { + "name": "aiVault.listSessions#2", + "ordinal": 7, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}" + }, + "7bdbee10feca": { "name": "aiVault.listSessions#1", - "ordinal": 5, - "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}" + "ordinal": 4, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": { + "issues": [], + "sessions": [ + { + "agent": "pi", + "cwd": "/repo/feature", + "id": "s1" + } + ] + } + } + } + }, + "7e8b2964ad63": { + "name": "streams-registered-at-teardown", + "ordinal": 8, + "value": [ + { + "cancelled": false, + "method": "agentSession.subscribeStatus", + "payload": "agentSession.subscribeStatus#1" + } + ] + }, + "98ac9d409279": { + "activeWorktreePath": "/repo/feature", + "refreshing": false, + "scope": "workspace", + "screenState": { + "issues": [], + "kind": "ready", + "sessions": [ + { + "agent": "pi", + "cwd": "/repo/feature", + "id": "s1" + } + ] + } }, "daf52dc85a58": { "name": "status.get#1", @@ -160,49 +205,6 @@ "value": { "$rpc": "undefined" } - }, - "f562eb25b111": { - "name": "aiVault.listSessions#1", - "ordinal": 4, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-3", - "ok": true, - "result": { - "issues": [], - "sessions": [ - { - "agent": "pi", - "cwd": "/repo/feature", - "id": "s1" - } - ] - } - } - } } }, "recording": { @@ -211,8 +213,8 @@ { "id": "ready", "observation": { - "sender": ["daf52dc85a58", "f562eb25b111"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "7bdbee10feca"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -223,8 +225,8 @@ { "id": "associated", "observation": { - "sender": ["daf52dc85a58", "f562eb25b111", "ad5b1230fc26"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18", "7f300f2af8fd"], + "sender": ["daf52dc85a58", "7bdbee10feca", "69310cf221d2"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3", "7a3238411452"], "settlements": { "mount": "eb79a9b3682a" }, @@ -235,8 +237,8 @@ { "id": "cleanup", "observation": { - "sender": ["daf52dc85a58", "f562eb25b111", "ad5b1230fc26"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18", "7f300f2af8fd"], + "sender": ["daf52dc85a58", "7bdbee10feca", "69310cf221d2"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3", "7a3238411452"], "settlements": { "mount": "eb79a9b3682a" }, diff --git a/mobile/rpc-foundation/goldens/aivault-history-scan-fulfilled.json b/mobile/rpc-foundation/goldens/aivault-history-scan-fulfilled.json index 90ae287ae9c..e67716ea050 100644 --- a/mobile/rpc-foundation/goldens/aivault-history-scan-fulfilled.json +++ b/mobile/rpc-foundation/goldens/aivault-history-scan-fulfilled.json @@ -4,6 +4,55 @@ "family": "aiVault.history", "namedDeltas": [], "values": { + "03fd6edde488": { + "name": "aiVault.listSessions#1", + "ordinal": 4, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": { + "issues": [], + "sessions": [ + { + "agent": "claude", + "cwd": "/repo/feature", + "id": "s1" + } + ] + } + } + } + }, + "2182656920b3": { + "name": "aiVault.listSessions#1", + "ordinal": 5, + "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}" + }, "44a27dbf05e2": { "name": "status.get#1", "ordinal": 3, @@ -36,54 +85,6 @@ ] } }, - "b6a16cc83e18": { - "name": "aiVault.listSessions#1", - "ordinal": 5, - "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}" - }, - "cb5715e0f275": { - "name": "aiVault.listSessions#1", - "ordinal": 4, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-3", - "ok": true, - "result": { - "issues": [], - "sessions": [ - { - "agent": "claude", - "cwd": "/repo/feature", - "id": "s1" - } - ] - } - } - } - }, "daf52dc85a58": { "name": "status.get#1", "ordinal": 2, @@ -138,8 +139,8 @@ { "id": "ready", "observation": { - "sender": ["daf52dc85a58", "cb5715e0f275"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "03fd6edde488"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -150,8 +151,8 @@ { "id": "cleanup", "observation": { - "sender": ["daf52dc85a58", "cb5715e0f275"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "03fd6edde488"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, diff --git a/mobile/rpc-foundation/goldens/aivault-history-scan-refresh.json b/mobile/rpc-foundation/goldens/aivault-history-scan-refresh.json index a17bf5126ab..06fafbf02ad 100644 --- a/mobile/rpc-foundation/goldens/aivault-history-scan-refresh.json +++ b/mobile/rpc-foundation/goldens/aivault-history-scan-refresh.json @@ -4,14 +4,9 @@ "family": "aiVault.history", "namedDeltas": [], "values": { - "33f381559396": { - "name": "aiVault.listSessions#2", - "ordinal": 7, - "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":true,\"scopePaths\":[\"/repo/feature\"]}}" - }, - "3f412a6bee67": { - "name": "aiVault.listSessions#2", - "ordinal": 6, + "03fd6edde488": { + "name": "aiVault.listSessions#1", + "ordinal": 4, "args": [ { "name": "method", @@ -20,8 +15,9 @@ { "name": "params", "value": { - "force": true, + "force": false, "limit": 500, + "scopeOnly": true, "scopePaths": ["/repo/feature"] } }, @@ -37,7 +33,7 @@ "startedAt": 0, "settledAt": 0, "value": { - "id": "frame-4", + "id": "frame-3", "ok": true, "result": { "issues": [], @@ -45,13 +41,23 @@ { "agent": "claude", "cwd": "/repo/feature", - "id": "s2" + "id": "s1" } ] } } } }, + "2182656920b3": { + "name": "aiVault.listSessions#1", + "ordinal": 5, + "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}" + }, + "422563aac194": { + "name": "aiVault.listSessions#2", + "ordinal": 7, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":true,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}" + }, "44a27dbf05e2": { "name": "status.get#1", "ordinal": 3, @@ -84,14 +90,9 @@ ] } }, - "b6a16cc83e18": { - "name": "aiVault.listSessions#1", - "ordinal": 5, - "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}" - }, - "cb5715e0f275": { - "name": "aiVault.listSessions#1", - "ordinal": 4, + "c23f94d5e35f": { + "name": "aiVault.listSessions#2", + "ordinal": 6, "args": [ { "name": "method", @@ -100,8 +101,9 @@ { "name": "params", "value": { - "force": false, + "force": true, "limit": 500, + "scopeOnly": true, "scopePaths": ["/repo/feature"] } }, @@ -117,7 +119,7 @@ "startedAt": 0, "settledAt": 0, "value": { - "id": "frame-3", + "id": "frame-4", "ok": true, "result": { "issues": [], @@ -125,7 +127,7 @@ { "agent": "claude", "cwd": "/repo/feature", - "id": "s1" + "id": "s2" } ] } @@ -202,8 +204,8 @@ { "id": "ready", "observation": { - "sender": ["daf52dc85a58", "cb5715e0f275"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "03fd6edde488"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -214,8 +216,8 @@ { "id": "refreshed", "observation": { - "sender": ["daf52dc85a58", "cb5715e0f275", "3f412a6bee67"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18", "33f381559396"], + "sender": ["daf52dc85a58", "03fd6edde488", "c23f94d5e35f"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3", "422563aac194"], "settlements": { "mount": "eb79a9b3682a", "refresh": "eb79a9b3682a" @@ -227,8 +229,8 @@ { "id": "cleanup", "observation": { - "sender": ["daf52dc85a58", "cb5715e0f275", "3f412a6bee67"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18", "33f381559396"], + "sender": ["daf52dc85a58", "03fd6edde488", "c23f94d5e35f"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3", "422563aac194"], "settlements": { "mount": "eb79a9b3682a", "refresh": "eb79a9b3682a" diff --git a/mobile/rpc-foundation/goldens/aivault-history-scan-revisit.json b/mobile/rpc-foundation/goldens/aivault-history-scan-revisit.json index 8294e2d8f18..33d90e61fe8 100644 --- a/mobile/rpc-foundation/goldens/aivault-history-scan-revisit.json +++ b/mobile/rpc-foundation/goldens/aivault-history-scan-revisit.json @@ -4,11 +4,94 @@ "family": "aiVault.history", "namedDeltas": [], "values": { + "03fd6edde488": { + "name": "aiVault.listSessions#1", + "ordinal": 4, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": { + "issues": [], + "sessions": [ + { + "agent": "claude", + "cwd": "/repo/feature", + "id": "s1" + } + ] + } + } + } + }, + "2182656920b3": { + "name": "aiVault.listSessions#1", + "ordinal": 5, + "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}" + }, "44a27dbf05e2": { "name": "status.get#1", "ordinal": 3, "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"status.get\"}" }, + "74067e8858fa": { + "name": "aiVault.listSessions#2", + "ordinal": 6, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "pending", + "startedAt": 31000 + } + }, + "7a3238411452": { + "name": "aiVault.listSessions#2", + "ordinal": 7, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}" + }, "7e8b2964ad63": { "name": "streams-registered-at-teardown", "ordinal": 8, @@ -20,11 +103,6 @@ } ] }, - "7f300f2af8fd": { - "name": "aiVault.listSessions#2", - "ordinal": 7, - "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}" - }, "9aa0df31dc4d": { "activeWorktreePath": "/repo/feature", "refreshing": false, @@ -62,11 +140,6 @@ ] } }, - "b6a16cc83e18": { - "name": "aiVault.listSessions#1", - "ordinal": 5, - "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}" - }, "c61a146bd377": { "status": "fulfilled", "startedAt": 31000, @@ -75,50 +148,7 @@ "$rpc": "undefined" } }, - "cb5715e0f275": { - "name": "aiVault.listSessions#1", - "ordinal": 4, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-3", - "ok": true, - "result": { - "issues": [], - "sessions": [ - { - "agent": "claude", - "cwd": "/repo/feature", - "id": "s1" - } - ] - } - } - } - }, - "d3637311be53": { + "c6add689704f": { "name": "aiVault.listSessions#2", "ordinal": 6, "args": [ @@ -131,6 +161,7 @@ "value": { "force": false, "limit": 500, + "scopeOnly": true, "scopePaths": ["/repo/feature"] } }, @@ -205,34 +236,6 @@ "ordinal": 1, "json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"agentSession.subscribeStatus\",\"params\":{}}" }, - "e702c32cb3d5": { - "name": "aiVault.listSessions#2", - "ordinal": 6, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "pending", - "startedAt": 31000 - } - }, "eb79a9b3682a": { "status": "fulfilled", "startedAt": 0, @@ -248,8 +251,8 @@ { "id": "ready", "observation": { - "sender": ["daf52dc85a58", "cb5715e0f275"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "03fd6edde488"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -260,8 +263,8 @@ { "id": "cached", "observation": { - "sender": ["daf52dc85a58", "cb5715e0f275", "e702c32cb3d5"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18", "7f300f2af8fd"], + "sender": ["daf52dc85a58", "03fd6edde488", "74067e8858fa"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3", "7a3238411452"], "settlements": { "mount": "eb79a9b3682a", "leave": "eb79a9b3682a", @@ -274,8 +277,8 @@ { "id": "revalidated", "observation": { - "sender": ["daf52dc85a58", "cb5715e0f275", "d3637311be53"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18", "7f300f2af8fd"], + "sender": ["daf52dc85a58", "03fd6edde488", "c6add689704f"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3", "7a3238411452"], "settlements": { "mount": "eb79a9b3682a", "leave": "eb79a9b3682a", @@ -288,8 +291,8 @@ { "id": "cleanup", "observation": { - "sender": ["daf52dc85a58", "cb5715e0f275", "d3637311be53"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18", "7f300f2af8fd"], + "sender": ["daf52dc85a58", "03fd6edde488", "c6add689704f"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3", "7a3238411452"], "settlements": { "mount": "eb79a9b3682a", "leave": "eb79a9b3682a", diff --git a/mobile/rpc-foundation/goldens/aivault-history-scan-worktrees-late.json b/mobile/rpc-foundation/goldens/aivault-history-scan-worktrees-late.json index 9fd95759ee2..54f4176da96 100644 --- a/mobile/rpc-foundation/goldens/aivault-history-scan-worktrees-late.json +++ b/mobile/rpc-foundation/goldens/aivault-history-scan-worktrees-late.json @@ -4,6 +4,55 @@ "family": "aiVault.history", "namedDeltas": [], "values": { + "03fd6edde488": { + "name": "aiVault.listSessions#1", + "ordinal": 4, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": { + "issues": [], + "sessions": [ + { + "agent": "claude", + "cwd": "/repo/feature", + "id": "s1" + } + ] + } + } + } + }, + "2182656920b3": { + "name": "aiVault.listSessions#1", + "ordinal": 5, + "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}" + }, "44a27dbf05e2": { "name": "status.get#1", "ordinal": 3, @@ -36,54 +85,6 @@ ] } }, - "b6a16cc83e18": { - "name": "aiVault.listSessions#1", - "ordinal": 5, - "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}" - }, - "cb5715e0f275": { - "name": "aiVault.listSessions#1", - "ordinal": 4, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-3", - "ok": true, - "result": { - "issues": [], - "sessions": [ - { - "agent": "claude", - "cwd": "/repo/feature", - "id": "s1" - } - ] - } - } - } - }, "daf52dc85a58": { "name": "status.get#1", "ordinal": 2, @@ -160,8 +161,8 @@ { "id": "ready", "observation": { - "sender": ["daf52dc85a58", "cb5715e0f275"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "03fd6edde488"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a", "worktrees-loaded": "eb79a9b3682a" @@ -173,8 +174,8 @@ { "id": "cleanup", "observation": { - "sender": ["daf52dc85a58", "cb5715e0f275"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "03fd6edde488"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a", "worktrees-loaded": "eb79a9b3682a" diff --git a/mobile/rpc-foundation/goldens/aivault-history-screen-listed.json b/mobile/rpc-foundation/goldens/aivault-history-screen-listed.json index 83bd3725664..f6035ae55c3 100644 --- a/mobile/rpc-foundation/goldens/aivault-history-screen-listed.json +++ b/mobile/rpc-foundation/goldens/aivault-history-screen-listed.json @@ -30,7 +30,7 @@ "startedAt": 0 } }, - "07299f73583f": { + "27ef7c5c6263": { "name": "aiVault.listSessions#1", "ordinal": 6, "args": [ @@ -43,6 +43,7 @@ "value": { "force": false, "limit": 500, + "scopeOnly": true, "scopePaths": ["/repo/feature"] } }, @@ -58,11 +59,6 @@ "startedAt": 0 } }, - "595e6c3bbfed": { - "name": "aiVault.listSessions#1", - "ordinal": 7, - "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}" - }, "7623e8b568b1": { "crash": { "$rpc": "null" @@ -95,42 +91,7 @@ } ] }, - "b7a7af14c8a5": { - "crash": { - "$rpc": "null" - }, - "elements": { - "ChevronLeft": 1, - "Defs": 1, - "LinearGradient": 1, - "Pressable": 5, - "Rect": 1, - "RefreshCw": 1, - "SafeAreaView": 1, - "Search": 1, - "SectionList": 1, - "Stop": 2, - "Svg": 1, - "Text": 5, - "TextInput": 1, - "View": 14 - }, - "labels": [ - "Back", - "Refresh agent sessions", - "Workspace", - "Project", - "All", - "Search sessions, repo:, path:" - ], - "text": ["Agent Session History", "orca-history", "Workspace", "Project", "All"] - }, - "d126597611a2": { - "name": "worktree.ps#1", - "ordinal": 3, - "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.ps\",\"params\":{\"limit\":10000,\"supportsWorktreeVisibilitySourceDefaults\":true}}" - }, - "df6890cb4985": { + "a03eeea51ba8": { "name": "aiVault.listSessions#1", "ordinal": 6, "args": [ @@ -143,6 +104,7 @@ "value": { "force": false, "limit": 500, + "scopeOnly": true, "scopePaths": ["/repo/feature"] } }, @@ -194,6 +156,46 @@ } } }, + "b7a7af14c8a5": { + "crash": { + "$rpc": "null" + }, + "elements": { + "ChevronLeft": 1, + "Defs": 1, + "LinearGradient": 1, + "Pressable": 5, + "Rect": 1, + "RefreshCw": 1, + "SafeAreaView": 1, + "Search": 1, + "SectionList": 1, + "Stop": 2, + "Svg": 1, + "Text": 5, + "TextInput": 1, + "View": 14 + }, + "labels": [ + "Back", + "Refresh agent sessions", + "Workspace", + "Project", + "All", + "Search sessions, repo:, path:" + ], + "text": ["Agent Session History", "orca-history", "Workspace", "Project", "All"] + }, + "d126597611a2": { + "name": "worktree.ps#1", + "ordinal": 3, + "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.ps\",\"params\":{\"limit\":10000,\"supportsWorktreeVisibilitySourceDefaults\":true}}" + }, + "dffc0668b556": { + "name": "aiVault.listSessions#1", + "ordinal": 7, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}" + }, "e28c488ce6b2": { "name": "agentSession.subscribeStatus#1", "ordinal": 1, @@ -305,8 +307,8 @@ { "id": "worktrees-listed", "observation": { - "sender": ["ebc8d9683b5e", "e881d7dabb25", "07299f73583f"], - "payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "595e6c3bbfed"], + "sender": ["ebc8d9683b5e", "e881d7dabb25", "27ef7c5c6263"], + "payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"], "settlements": { "mount": "eb79a9b3682a" }, @@ -317,8 +319,8 @@ { "id": "ready", "observation": { - "sender": ["ebc8d9683b5e", "e881d7dabb25", "df6890cb4985"], - "payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "595e6c3bbfed"], + "sender": ["ebc8d9683b5e", "e881d7dabb25", "a03eeea51ba8"], + "payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"], "settlements": { "mount": "eb79a9b3682a" }, @@ -329,8 +331,8 @@ { "id": "cleanup", "observation": { - "sender": ["ebc8d9683b5e", "e881d7dabb25", "df6890cb4985"], - "payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "595e6c3bbfed"], + "sender": ["ebc8d9683b5e", "e881d7dabb25", "a03eeea51ba8"], + "payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"], "settlements": { "mount": "eb79a9b3682a" }, diff --git a/mobile/rpc-foundation/goldens/aivault-history-screen-worktrees.json b/mobile/rpc-foundation/goldens/aivault-history-screen-worktrees.json index abfbd736429..9b794c5f0fb 100644 --- a/mobile/rpc-foundation/goldens/aivault-history-screen-worktrees.json +++ b/mobile/rpc-foundation/goldens/aivault-history-screen-worktrees.json @@ -30,7 +30,7 @@ "startedAt": 0 } }, - "07299f73583f": { + "27ef7c5c6263": { "name": "aiVault.listSessions#1", "ordinal": 6, "args": [ @@ -43,6 +43,7 @@ "value": { "force": false, "limit": 500, + "scopeOnly": true, "scopePaths": ["/repo/feature"] } }, @@ -58,11 +59,6 @@ "startedAt": 0 } }, - "595e6c3bbfed": { - "name": "aiVault.listSessions#1", - "ordinal": 7, - "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}" - }, "7623e8b568b1": { "crash": { "$rpc": "null" @@ -95,11 +91,51 @@ } ] }, + "a0b80301d553": { + "name": "aiVault.listSessions#1", + "ordinal": 6, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "Connection closed", + "isRpcDeliveryUnknown": true + } + } + }, "d126597611a2": { "name": "worktree.ps#1", "ordinal": 3, "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.ps\",\"params\":{\"limit\":10000,\"supportsWorktreeVisibilitySourceDefaults\":true}}" }, + "dffc0668b556": { + "name": "aiVault.listSessions#1", + "ordinal": 7, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}" + }, "e28c488ce6b2": { "name": "agentSession.subscribeStatus#1", "ordinal": 1, @@ -191,40 +227,6 @@ } } } - }, - "f13239f2c039": { - "name": "aiVault.listSessions#1", - "ordinal": 6, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "Connection closed", - "isRpcDeliveryUnknown": true - } - } } }, "recording": { @@ -245,8 +247,8 @@ { "id": "worktrees-listed", "observation": { - "sender": ["ebc8d9683b5e", "e881d7dabb25", "07299f73583f"], - "payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "595e6c3bbfed"], + "sender": ["ebc8d9683b5e", "e881d7dabb25", "27ef7c5c6263"], + "payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"], "settlements": { "mount": "eb79a9b3682a" }, @@ -257,8 +259,8 @@ { "id": "cleanup", "observation": { - "sender": ["ebc8d9683b5e", "e881d7dabb25", "f13239f2c039"], - "payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "595e6c3bbfed"], + "sender": ["ebc8d9683b5e", "e881d7dabb25", "a0b80301d553"], + "payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"], "settlements": { "mount": "eb79a9b3682a" }, diff --git a/mobile/rpc-foundation/goldens/matrix-aivault.history-aivault.listsessions-1.json b/mobile/rpc-foundation/goldens/matrix-aivault.history-aivault.listsessions-1.json index 33f7d253ef9..3d52b2d86ac 100644 --- a/mobile/rpc-foundation/goldens/matrix-aivault.history-aivault.listsessions-1.json +++ b/mobile/rpc-foundation/goldens/matrix-aivault.history-aivault.listsessions-1.json @@ -4,419 +4,7 @@ "family": "aiVault.history", "namedDeltas": [], "values": { - "2d708a37d5ea": { - "name": "aiVault.listSessions#1", - "ordinal": 4, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-3", - "ok": true, - "result": { - "error": "refused" - } - } - } - }, - "30f2a42bed00": { - "activeWorktreePath": "/repo/feature", - "refreshing": false, - "scope": "workspace", - "screenState": { - "kind": "loading" - } - }, - "3f0d3328af85": { - "name": "aiVault.listSessions#1", - "ordinal": 4, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "error": { - "code": "refused", - "message": "outer refused" - }, - "id": "frame-3", - "ok": false - } - } - }, - "44a27dbf05e2": { - "name": "status.get#1", - "ordinal": 3, - "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"status.get\"}" - }, - "54a7c3bc47d2": { - "name": "aiVault.listSessions#2", - "ordinal": 6, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "Connection closed", - "isRpcDeliveryUnknown": true - } - } - }, - "6919c6d453c4": { - "name": "aiVault.listSessions#1", - "ordinal": 4, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "", - "isRpcDeliveryUnknown": true - } - } - }, - "758b3fde1948": { - "name": "streams-registered-at-teardown", - "ordinal": 6, - "value": [ - { - "cancelled": false, - "method": "agentSession.subscribeStatus", - "payload": "agentSession.subscribeStatus#1" - } - ] - }, - "7d9b0e9536df": { - "name": "aiVault.listSessions#2", - "ordinal": 6, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "pending", - "startedAt": 0 - } - }, - "7e8b2964ad63": { - "name": "streams-registered-at-teardown", - "ordinal": 8, - "value": [ - { - "cancelled": false, - "method": "agentSession.subscribeStatus", - "payload": "agentSession.subscribeStatus#1" - } - ] - }, - "7f300f2af8fd": { - "name": "aiVault.listSessions#2", - "ordinal": 7, - "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}" - }, - "86a28f6d8cdc": { - "activeWorktreePath": "/repo/feature", - "refreshing": false, - "scope": "workspace", - "screenState": { - "kind": "error", - "message": "outer refused" - } - }, - "8fc90c2a1d6c": { - "name": "aiVault.listSessions#1", - "ordinal": 4, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "transport failure", - "isRpcDeliveryUnknown": true - } - } - }, - "9aa0df31dc4d": { - "activeWorktreePath": "/repo/feature", - "refreshing": false, - "scope": "workspace", - "screenState": { - "issues": [], - "kind": "ready", - "sessions": [ - { - "agent": "claude", - "cwd": "/repo/feature", - "id": "s1" - } - ] - } - }, - "a60ec274c87f": { - "activeWorktreePath": "/repo/feature", - "refreshing": false, - "scope": "workspace", - "screenState": { - "kind": "error", - "message": "The host sent a reply this app could not read (aiVault.listSessions)" - } - }, - "b6a16cc83e18": { - "name": "aiVault.listSessions#1", - "ordinal": 5, - "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}" - }, - "b838b12acde6": { - "activeWorktreePath": "/repo/feature", - "refreshing": false, - "scope": "workspace", - "screenState": { - "kind": "error", - "message": "Unknown method" - } - }, - "c23be45f1637": { - "activeWorktreePath": "/repo/feature", - "refreshing": false, - "scope": "workspace", - "screenState": { - "kind": "error", - "message": "Unable to load agent sessions" - } - }, - "c5a0bb1d4a76": { - "name": "aiVault.listSessions#1", - "ordinal": 4, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-3", - "ok": true, - "result": { - "error": "inner refused", - "ok": false - } - } - } - }, - "c7ccb71459eb": { - "name": "aiVault.listSessions#1", - "ordinal": 4, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-3", - "ok": true, - "result": { - "$rpc": "null" - } - } - } - }, - "c967ce34a622": { - "name": "aiVault.listSessions#1", - "ordinal": 4, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-3", - "ok": true, - "result": { - "error": { - "message": "inner refused" - }, - "ok": false - } - } - } - }, - "cb5715e0f275": { + "03fd6edde488": { "name": "aiVault.listSessions#1", "ordinal": 4, "args": [ @@ -429,6 +17,7 @@ "value": { "force": false, "limit": 500, + "scopeOnly": true, "scopePaths": ["/repo/feature"] } }, @@ -459,7 +48,49 @@ } } }, - "d16bd9a670c3": { + "2182656920b3": { + "name": "aiVault.listSessions#1", + "ordinal": 5, + "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}" + }, + "22fcaac5d4c6": { + "name": "aiVault.listSessions#2", + "ordinal": 6, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "pending", + "startedAt": 0 + } + }, + "30f2a42bed00": { + "activeWorktreePath": "/repo/feature", + "refreshing": false, + "scope": "workspace", + "screenState": { + "kind": "loading" + } + }, + "3354c863b6ab": { "name": "aiVault.listSessions#1", "ordinal": 4, "args": [ @@ -472,6 +103,45 @@ "value": { "force": false, "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": { + "error": "inner refused", + "ok": false + } + } + } + }, + "352956d73b28": { + "name": "aiVault.listSessions#1", + "ordinal": 4, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, "scopePaths": ["/repo/feature"] } }, @@ -496,7 +166,23 @@ } } }, - "d4b9d334dde7": { + "44a27dbf05e2": { + "name": "status.get#1", + "ordinal": 3, + "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"status.get\"}" + }, + "758b3fde1948": { + "name": "streams-registered-at-teardown", + "ordinal": 6, + "value": [ + { + "cancelled": false, + "method": "agentSession.subscribeStatus", + "payload": "agentSession.subscribeStatus#1" + } + ] + }, + "77e40752545b": { "name": "aiVault.listSessions#1", "ordinal": 4, "args": [ @@ -509,6 +195,7 @@ "value": { "force": false, "limit": 500, + "scopeOnly": true, "scopePaths": ["/repo/feature"] } }, @@ -529,6 +216,369 @@ } } }, + "7a3238411452": { + "name": "aiVault.listSessions#2", + "ordinal": 7, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}" + }, + "7b5906668e74": { + "name": "aiVault.listSessions#1", + "ordinal": 4, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": { + "$rpc": "null" + } + } + } + }, + "7e8b2964ad63": { + "name": "streams-registered-at-teardown", + "ordinal": 8, + "value": [ + { + "cancelled": false, + "method": "agentSession.subscribeStatus", + "payload": "agentSession.subscribeStatus#1" + } + ] + }, + "7e910f2e6951": { + "name": "aiVault.listSessions#1", + "ordinal": 4, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "transport failure", + "isRpcDeliveryUnknown": true + } + } + }, + "86a28f6d8cdc": { + "activeWorktreePath": "/repo/feature", + "refreshing": false, + "scope": "workspace", + "screenState": { + "kind": "error", + "message": "outer refused" + } + }, + "95ba1077fb6d": { + "name": "aiVault.listSessions#1", + "ordinal": 4, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": { + "error": "refused" + } + } + } + }, + "9aa0df31dc4d": { + "activeWorktreePath": "/repo/feature", + "refreshing": false, + "scope": "workspace", + "screenState": { + "issues": [], + "kind": "ready", + "sessions": [ + { + "agent": "claude", + "cwd": "/repo/feature", + "id": "s1" + } + ] + } + }, + "9cfa0bcd2a8a": { + "name": "aiVault.listSessions#1", + "ordinal": 4, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "error": { + "code": "refused", + "message": "" + }, + "id": "frame-3", + "ok": false + } + } + }, + "a60ec274c87f": { + "activeWorktreePath": "/repo/feature", + "refreshing": false, + "scope": "workspace", + "screenState": { + "kind": "error", + "message": "The host sent a reply this app could not read (aiVault.listSessions)" + } + }, + "a91d79d0bc23": { + "name": "aiVault.listSessions#2", + "ordinal": 6, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "Connection closed", + "isRpcDeliveryUnknown": true + } + } + }, + "b838b12acde6": { + "activeWorktreePath": "/repo/feature", + "refreshing": false, + "scope": "workspace", + "screenState": { + "kind": "error", + "message": "Unknown method" + } + }, + "bcc1d8502cdb": { + "name": "aiVault.listSessions#1", + "ordinal": 4, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "", + "isRpcDeliveryUnknown": true + } + } + }, + "c23be45f1637": { + "activeWorktreePath": "/repo/feature", + "refreshing": false, + "scope": "workspace", + "screenState": { + "kind": "error", + "message": "Unable to load agent sessions" + } + }, + "c82cd1b39ee0": { + "name": "aiVault.listSessions#1", + "ordinal": 4, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "error": { + "code": "refused", + "message": "outer refused" + }, + "id": "frame-3", + "ok": false + } + } + }, + "cd9a4ebd035d": { + "name": "aiVault.listSessions#1", + "ordinal": 4, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": { + "error": { + "message": "inner refused" + }, + "ok": false + } + } + } + }, "daf52dc85a58": { "name": "status.get#1", "ordinal": 2, @@ -575,43 +625,6 @@ "value": { "$rpc": "undefined" } - }, - "f37a7212d893": { - "name": "aiVault.listSessions#1", - "ordinal": 4, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "error": { - "code": "refused", - "message": "" - }, - "id": "frame-3", - "ok": false - } - } } }, "recording": { @@ -620,8 +633,8 @@ { "id": "aivault-history-scan-fulfilled.normal:ready", "observation": { - "sender": ["daf52dc85a58", "cb5715e0f275"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "03fd6edde488"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -632,8 +645,8 @@ { "id": "aivault-history-scan-fulfilled.normal:cleanup", "observation": { - "sender": ["daf52dc85a58", "cb5715e0f275"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "03fd6edde488"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -644,8 +657,8 @@ { "id": "aivault-history-scan-fulfilled.result-absent:ready", "observation": { - "sender": ["daf52dc85a58", "d4b9d334dde7"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "77e40752545b"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -656,8 +669,8 @@ { "id": "aivault-history-scan-fulfilled.result-absent:cleanup", "observation": { - "sender": ["daf52dc85a58", "d4b9d334dde7"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "77e40752545b"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -668,8 +681,8 @@ { "id": "aivault-history-scan-fulfilled.result-null:ready", "observation": { - "sender": ["daf52dc85a58", "c7ccb71459eb"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "7b5906668e74"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -680,8 +693,8 @@ { "id": "aivault-history-scan-fulfilled.result-null:cleanup", "observation": { - "sender": ["daf52dc85a58", "c7ccb71459eb"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "7b5906668e74"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -692,8 +705,8 @@ { "id": "aivault-history-scan-fulfilled.inner-ok-missing:ready", "observation": { - "sender": ["daf52dc85a58", "2d708a37d5ea"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "95ba1077fb6d"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -704,8 +717,8 @@ { "id": "aivault-history-scan-fulfilled.inner-ok-missing:cleanup", "observation": { - "sender": ["daf52dc85a58", "2d708a37d5ea"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "95ba1077fb6d"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -716,8 +729,8 @@ { "id": "aivault-history-scan-fulfilled.inner-false-string-error:ready", "observation": { - "sender": ["daf52dc85a58", "c5a0bb1d4a76"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "3354c863b6ab"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -728,8 +741,8 @@ { "id": "aivault-history-scan-fulfilled.inner-false-string-error:cleanup", "observation": { - "sender": ["daf52dc85a58", "c5a0bb1d4a76"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "3354c863b6ab"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -740,8 +753,8 @@ { "id": "aivault-history-scan-fulfilled.inner-false-object-error:ready", "observation": { - "sender": ["daf52dc85a58", "c967ce34a622"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "cd9a4ebd035d"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -752,8 +765,8 @@ { "id": "aivault-history-scan-fulfilled.inner-false-object-error:cleanup", "observation": { - "sender": ["daf52dc85a58", "c967ce34a622"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "cd9a4ebd035d"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -764,8 +777,8 @@ { "id": "aivault-history-scan-fulfilled.outer-refused:ready", "observation": { - "sender": ["daf52dc85a58", "3f0d3328af85"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "c82cd1b39ee0"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -776,8 +789,8 @@ { "id": "aivault-history-scan-fulfilled.outer-refused:cleanup", "observation": { - "sender": ["daf52dc85a58", "3f0d3328af85"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "c82cd1b39ee0"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -788,8 +801,8 @@ { "id": "aivault-history-scan-fulfilled.outer-refused-no-message:ready", "observation": { - "sender": ["daf52dc85a58", "f37a7212d893"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "9cfa0bcd2a8a"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -800,8 +813,8 @@ { "id": "aivault-history-scan-fulfilled.outer-refused-no-message:cleanup", "observation": { - "sender": ["daf52dc85a58", "f37a7212d893"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "9cfa0bcd2a8a"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -812,8 +825,8 @@ { "id": "aivault-history-scan-fulfilled.method-not-found:ready", "observation": { - "sender": ["daf52dc85a58", "d16bd9a670c3"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "352956d73b28"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -824,8 +837,8 @@ { "id": "aivault-history-scan-fulfilled.method-not-found:cleanup", "observation": { - "sender": ["daf52dc85a58", "d16bd9a670c3"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "352956d73b28"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -836,8 +849,8 @@ { "id": "aivault-history-scan-fulfilled.transport-rejection:ready", "observation": { - "sender": ["daf52dc85a58", "8fc90c2a1d6c", "7d9b0e9536df"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18", "7f300f2af8fd"], + "sender": ["daf52dc85a58", "7e910f2e6951", "22fcaac5d4c6"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3", "7a3238411452"], "settlements": { "mount": "eb79a9b3682a" }, @@ -848,8 +861,8 @@ { "id": "aivault-history-scan-fulfilled.transport-rejection:cleanup", "observation": { - "sender": ["daf52dc85a58", "8fc90c2a1d6c", "54a7c3bc47d2"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18", "7f300f2af8fd"], + "sender": ["daf52dc85a58", "7e910f2e6951", "a91d79d0bc23"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3", "7a3238411452"], "settlements": { "mount": "eb79a9b3682a" }, @@ -860,8 +873,8 @@ { "id": "aivault-history-scan-fulfilled.transport-rejection-no-message:ready", "observation": { - "sender": ["daf52dc85a58", "6919c6d453c4", "7d9b0e9536df"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18", "7f300f2af8fd"], + "sender": ["daf52dc85a58", "bcc1d8502cdb", "22fcaac5d4c6"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3", "7a3238411452"], "settlements": { "mount": "eb79a9b3682a" }, @@ -872,8 +885,8 @@ { "id": "aivault-history-scan-fulfilled.transport-rejection-no-message:cleanup", "observation": { - "sender": ["daf52dc85a58", "6919c6d453c4", "54a7c3bc47d2"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18", "7f300f2af8fd"], + "sender": ["daf52dc85a58", "bcc1d8502cdb", "a91d79d0bc23"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3", "7a3238411452"], "settlements": { "mount": "eb79a9b3682a" }, diff --git a/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-platform-status.json b/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-platform-status.json index ff07aab20a7..3e80fea83f5 100644 --- a/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-platform-status.json +++ b/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-platform-status.json @@ -30,34 +30,6 @@ "startedAt": 0 } }, - "07299f73583f": { - "name": "aiVault.listSessions#1", - "ordinal": 6, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "pending", - "startedAt": 0 - } - }, "0cf3d278751b": { "name": "status.get#1", "ordinal": 4, @@ -192,6 +164,35 @@ } } }, + "27ef7c5c6263": { + "name": "aiVault.listSessions#1", + "ordinal": 6, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "pending", + "startedAt": 0 + } + }, "2ce0b0bdae00": { "name": "status.get#2", "ordinal": 6, @@ -259,11 +260,6 @@ } } }, - "595e6c3bbfed": { - "name": "aiVault.listSessions#1", - "ordinal": 7, - "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}" - }, "68435dd07fce": { "name": "status.get#2", "ordinal": 6, @@ -472,6 +468,41 @@ "Retry" ] }, + "a0b80301d553": { + "name": "aiVault.listSessions#1", + "ordinal": 6, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "Connection closed", + "isRpcDeliveryUnknown": true + } + } + }, "a24196eaf702": { "name": "status.get#1", "ordinal": 4, @@ -584,6 +615,11 @@ "Update Orca on this host to browse agent session history." ] }, + "dffc0668b556": { + "name": "aiVault.listSessions#1", + "ordinal": 7, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}" + }, "e28c488ce6b2": { "name": "agentSession.subscribeStatus#1", "ordinal": 1, @@ -676,40 +712,6 @@ } } }, - "f13239f2c039": { - "name": "aiVault.listSessions#1", - "ordinal": 6, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "Connection closed", - "isRpcDeliveryUnknown": true - } - } - }, "f975325adbf9": { "crash": { "$rpc": "null" @@ -800,8 +802,8 @@ { "id": "aivault-history-screen-worktrees.normal:worktrees-listed", "observation": { - "sender": ["ebc8d9683b5e", "e881d7dabb25", "07299f73583f"], - "payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "595e6c3bbfed"], + "sender": ["ebc8d9683b5e", "e881d7dabb25", "27ef7c5c6263"], + "payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"], "settlements": { "mount": "eb79a9b3682a" }, @@ -812,8 +814,8 @@ { "id": "aivault-history-screen-worktrees.normal:cleanup", "observation": { - "sender": ["ebc8d9683b5e", "e881d7dabb25", "f13239f2c039"], - "payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "595e6c3bbfed"], + "sender": ["ebc8d9683b5e", "e881d7dabb25", "a0b80301d553"], + "payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"], "settlements": { "mount": "eb79a9b3682a" }, diff --git a/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-worktree.ps-1.json b/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-worktree.ps-1.json index 48e22cbe7ad..0111ee05d69 100644 --- a/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-worktree.ps-1.json +++ b/mobile/rpc-foundation/goldens/matrix-aivault.history-screen-worktree.ps-1.json @@ -30,34 +30,6 @@ "startedAt": 0 } }, - "07299f73583f": { - "name": "aiVault.listSessions#1", - "ordinal": 6, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "pending", - "startedAt": 0 - } - }, "111e9a5009ba": { "name": "streams-registered-at-teardown", "ordinal": 4, @@ -103,6 +75,35 @@ } } }, + "27ef7c5c6263": { + "name": "aiVault.listSessions#1", + "ordinal": 6, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "pending", + "startedAt": 0 + } + }, "519ce9879c6f": { "name": "worktree.ps#1", "ordinal": 2, @@ -138,11 +139,6 @@ } } }, - "595e6c3bbfed": { - "name": "aiVault.listSessions#1", - "ordinal": 7, - "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}" - }, "5a2900554f7f": { "name": "worktree.ps#1", "ordinal": 2, @@ -351,6 +347,41 @@ } } }, + "a0b80301d553": { + "name": "aiVault.listSessions#1", + "ordinal": 6, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "rejected", + "startedAt": 0, + "settledAt": 0, + "error": { + "category": "Error", + "message": "Connection closed", + "isRpcDeliveryUnknown": true + } + } + }, "bdd2f2097a96": { "name": "worktree.ps#1", "ordinal": 2, @@ -455,6 +486,11 @@ "ordinal": 3, "json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.ps\",\"params\":{\"limit\":10000,\"supportsWorktreeVisibilitySourceDefaults\":true}}" }, + "dffc0668b556": { + "name": "aiVault.listSessions#1", + "ordinal": 7, + "json": "{\"id\":\"frame-4\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}" + }, "e28c488ce6b2": { "name": "agentSession.subscribeStatus#1", "ordinal": 1, @@ -579,40 +615,6 @@ } } }, - "f13239f2c039": { - "name": "aiVault.listSessions#1", - "ordinal": 6, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "rejected", - "startedAt": 0, - "settledAt": 0, - "error": { - "category": "Error", - "message": "Connection closed", - "isRpcDeliveryUnknown": true - } - } - }, "fe3fd26f3355": { "name": "aiVault.listSessions#1", "ordinal": 6, @@ -707,8 +709,8 @@ { "id": "aivault-history-screen-worktrees.normal:worktrees-listed", "observation": { - "sender": ["ebc8d9683b5e", "e881d7dabb25", "07299f73583f"], - "payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "595e6c3bbfed"], + "sender": ["ebc8d9683b5e", "e881d7dabb25", "27ef7c5c6263"], + "payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"], "settlements": { "mount": "eb79a9b3682a" }, @@ -719,8 +721,8 @@ { "id": "aivault-history-screen-worktrees.normal:cleanup", "observation": { - "sender": ["ebc8d9683b5e", "e881d7dabb25", "f13239f2c039"], - "payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "595e6c3bbfed"], + "sender": ["ebc8d9683b5e", "e881d7dabb25", "a0b80301d553"], + "payloads": ["e28c488ce6b2", "d126597611a2", "7c48e0564605", "dffc0668b556"], "settlements": { "mount": "eb79a9b3682a" }, diff --git a/mobile/rpc-foundation/goldens/matrix-aivault.history-status.get-1.json b/mobile/rpc-foundation/goldens/matrix-aivault.history-status.get-1.json index f95d159753a..c89d3b1d72c 100644 --- a/mobile/rpc-foundation/goldens/matrix-aivault.history-status.get-1.json +++ b/mobile/rpc-foundation/goldens/matrix-aivault.history-status.get-1.json @@ -4,6 +4,50 @@ "family": "aiVault.history", "namedDeltas": [], "values": { + "03fd6edde488": { + "name": "aiVault.listSessions#1", + "ordinal": 4, + "args": [ + { + "name": "method", + "value": "aiVault.listSessions" + }, + { + "name": "params", + "value": { + "force": false, + "limit": 500, + "scopeOnly": true, + "scopePaths": ["/repo/feature"] + } + }, + { + "name": "options", + "value": { + "failWhenDisconnected": true + } + } + ], + "settlement": { + "status": "fulfilled", + "startedAt": 0, + "settledAt": 0, + "value": { + "id": "frame-3", + "ok": true, + "result": { + "issues": [], + "sessions": [ + { + "agent": "claude", + "cwd": "/repo/feature", + "id": "s1" + } + ] + } + } + } + }, "0753498763d5": { "name": "status.get#1", "ordinal": 2, @@ -58,6 +102,11 @@ "kind": "unsupported" } }, + "2182656920b3": { + "name": "aiVault.listSessions#1", + "ordinal": 5, + "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"],\"scopeOnly\":true}}" + }, "2289d07f6bea": { "name": "status.get#1", "ordinal": 2, @@ -316,11 +365,6 @@ } } }, - "b6a16cc83e18": { - "name": "aiVault.listSessions#1", - "ordinal": 5, - "json": "{\"id\":\"frame-3\",\"deviceToken\":\"recording-device\",\"method\":\"aiVault.listSessions\",\"params\":{\"limit\":500,\"force\":false,\"scopePaths\":[\"/repo/feature\"]}}" - }, "b838b12acde6": { "activeWorktreePath": "/repo/feature", "refreshing": false, @@ -374,49 +418,6 @@ } } }, - "cb5715e0f275": { - "name": "aiVault.listSessions#1", - "ordinal": 4, - "args": [ - { - "name": "method", - "value": "aiVault.listSessions" - }, - { - "name": "params", - "value": { - "force": false, - "limit": 500, - "scopePaths": ["/repo/feature"] - } - }, - { - "name": "options", - "value": { - "failWhenDisconnected": true - } - } - ], - "settlement": { - "status": "fulfilled", - "startedAt": 0, - "settledAt": 0, - "value": { - "id": "frame-3", - "ok": true, - "result": { - "issues": [], - "sessions": [ - { - "agent": "claude", - "cwd": "/repo/feature", - "id": "s1" - } - ] - } - } - } - }, "d0831ff38203": { "name": "status.get#1", "ordinal": 2, @@ -604,8 +605,8 @@ { "id": "aivault-history-scan-fulfilled.normal:ready", "observation": { - "sender": ["daf52dc85a58", "cb5715e0f275"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "03fd6edde488"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, @@ -616,8 +617,8 @@ { "id": "aivault-history-scan-fulfilled.normal:cleanup", "observation": { - "sender": ["daf52dc85a58", "cb5715e0f275"], - "payloads": ["e28c488ce6b2", "44a27dbf05e2", "b6a16cc83e18"], + "sender": ["daf52dc85a58", "03fd6edde488"], + "payloads": ["e28c488ce6b2", "44a27dbf05e2", "2182656920b3"], "settlements": { "mount": "eb79a9b3682a" }, diff --git a/mobile/rpc-foundation/pilot-scenarios.json b/mobile/rpc-foundation/pilot-scenarios.json index 578ed240f88..5be06b0d6b0 100644 --- a/mobile/rpc-foundation/pilot-scenarios.json +++ b/mobile/rpc-foundation/pilot-scenarios.json @@ -15597,6 +15597,7 @@ "params": { "force": false, "limit": 500, + "scopeOnly": true, "scopePaths": ["/repo/feature"] }, "reply": { @@ -15684,6 +15685,7 @@ "params": { "force": false, "limit": 500, + "scopeOnly": true, "scopePaths": ["/repo/feature"] }, "reply": { @@ -15733,6 +15735,7 @@ "params": { "force": false, "limit": 500, + "scopeOnly": true, "scopePaths": ["/repo/feature"] }, "reply": { @@ -15771,6 +15774,7 @@ "params": { "force": false, "limit": 500, + "scopeOnly": true, "scopePaths": ["/repo/feature"] }, "reply": { @@ -15825,6 +15829,7 @@ "params": { "force": false, "limit": 500, + "scopeOnly": true, "scopePaths": ["/repo/feature"] }, "reply": { @@ -15853,6 +15858,7 @@ "params": { "force": true, "limit": 500, + "scopeOnly": true, "scopePaths": ["/repo/feature"] }, "reply": { @@ -15902,6 +15908,7 @@ "params": { "force": false, "limit": 500, + "scopeOnly": true, "scopePaths": ["/repo/feature"] }, "reply": { @@ -15952,6 +15959,7 @@ "params": { "force": false, "limit": 500, + "scopeOnly": true, "scopePaths": ["/repo/feature"] }, "reply": { @@ -21336,6 +21344,7 @@ "params": { "force": false, "limit": 500, + "scopeOnly": true, "scopePaths": ["/repo/feature"] }, "reply": { diff --git a/mobile/src/agent-history/agent-history-scope-paths.test.ts b/mobile/src/agent-history/agent-history-scope-paths.test.ts index 790408afb37..018129e9013 100644 --- a/mobile/src/agent-history/agent-history-scope-paths.test.ts +++ b/mobile/src/agent-history/agent-history-scope-paths.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest' import { deriveMobileAiVaultScopePaths, - mobileAiVaultScanScopePaths + mobileAiVaultScanScopeArgs } from './agent-history-scope-paths' const worktree = (worktreeId: string, path: string) => ({ worktreeId, path, repoId: 'repo-1' }) @@ -14,11 +14,13 @@ describe('mobile AI Vault scope paths', () => { it('caps only the scan hints, so an older host accepts them and Project still shows every sibling', () => { const scopePaths = deriveMobileAiVaultScopePaths('project', active, [active, ...siblings]) - const scanPaths = mobileAiVaultScanScopePaths(scopePaths) + const scan = mobileAiVaultScanScopeArgs('project', scopePaths) expect(scopePaths).toHaveLength(201) - expect(scanPaths).toHaveLength(64) + expect(scan.scopePaths).toHaveLength(64) // Active worktree is seeded first, so it survives truncation. - expect(scanPaths[0]).toBe('/Users/ada/repo/app') + expect(scan.scopePaths?.[0]).toBe('/Users/ada/repo/app') + // A capped scope can't answer alone, so the host keeps its recency scan. + expect(scan.scopeOnly).toBeUndefined() }) }) diff --git a/mobile/src/agent-history/agent-history-scope-paths.ts b/mobile/src/agent-history/agent-history-scope-paths.ts index 5f1d7107780..ab0ba73465d 100644 --- a/mobile/src/agent-history/agent-history-scope-paths.ts +++ b/mobile/src/agent-history/agent-history-scope-paths.ts @@ -1,6 +1,7 @@ import { deriveAiVaultScopeSessionPaths } from '../../../src/shared/ai-vault/scanning/ai-vault-scope-paths' import { - AI_VAULT_SCOPE_PATHS_MAX_COUNT, + boundedAiVaultScopeArgs, + type AiVaultListArgs, type AiVaultScope } from '../../../src/shared/ai-vault/contracts/ai-vault-types' import type { Worktree } from '../worktree/workspace-list-types' @@ -23,9 +24,12 @@ export function deriveMobileAiVaultScopePaths( ) } -/** The scan hints sent to the host; older hosts reject oversized scopePaths, and hints only widen discovery. */ -export function mobileAiVaultScanScopePaths(scopePaths: readonly string[]): string[] { - return scopePaths.slice(0, AI_VAULT_SCOPE_PATHS_MAX_COUNT) +/** The scope sent to the host: capped because older hosts reject oversized scopePaths; All keeps the recency scan. */ +export function mobileAiVaultScanScopeArgs( + scope: AiVaultScope, + scopePaths: readonly string[] +): Pick { + return boundedAiVaultScopeArgs(scopePaths, scope !== 'all') } function toScopePathWorktree(worktree: ScopeWorktree) { diff --git a/mobile/src/agent-history/use-mobile-agent-history-state.ts b/mobile/src/agent-history/use-mobile-agent-history-state.ts index 49bad58128d..5b8ebe2e2bc 100644 --- a/mobile/src/agent-history/use-mobile-agent-history-state.ts +++ b/mobile/src/agent-history/use-mobile-agent-history-state.ts @@ -17,7 +17,7 @@ import { defineHostQuery, readHostQueryLive, useHostQuery } from '../query/host- import { hostScreenState } from '../query/host-query-screen-state' import { deriveMobileAiVaultScopePaths, - mobileAiVaultScanScopePaths + mobileAiVaultScanScopeArgs } from './agent-history-scope-paths' import { agentHistoryCapabilityRead, @@ -65,6 +65,7 @@ type ScanScope = { scopeFilterPaths: string[]; activeWorktreePath: string | null async function readAgentHistory( client: RpcClient, + scope: AiVaultScope, scan: ScanScope, force: boolean, associationRevision: number @@ -81,7 +82,8 @@ async function readAgentHistory( const reply = await agentHistorySessionScan.request(client, { limit: MOBILE_AI_VAULT_SESSION_LIMIT, force, - scopePaths: mobileAiVaultScanScopePaths(scan.scopeFilterPaths) + // From the query's own scope key, so rows cached under Workspace are always Workspace-only ones. + ...mobileAiVaultScanScopeArgs(scope, scan.scopeFilterPaths) }) const result = interpretOrThrowRefusalMessage( () => agentHistorySessionScan.interpret(reply), @@ -111,7 +113,7 @@ function agentHistoryQuery( // No desktop signal for new transcripts, so foreground revalidates once older than 30 s. refetchOnWindowFocus: true, fetch: (client, _target, input: { scope: AiVaultScope }) => - readAgentHistory(client, scan, force, startRevision(input.scope)) + readAgentHistory(client, input.scope, scan, force, startRevision(input.scope)) }) } diff --git a/src/main/ai-vault/ai-vault-runtime-scan.ts b/src/main/ai-vault/ai-vault-runtime-scan.ts index 36f4729b10f..23c48f085f5 100644 --- a/src/main/ai-vault/ai-vault-runtime-scan.ts +++ b/src/main/ai-vault/ai-vault-runtime-scan.ts @@ -81,6 +81,9 @@ function runtimeScanArgs( if (listArgs?.scopePaths !== undefined) { scanArgs.scopePaths = listArgs.scopePaths } + if (listArgs?.scopeOnly === true) { + scanArgs.scopeOnly = true + } if (listArgs?.includeAntigravityIdeSessions === true) { scanArgs.includeAntigravityIdeSessions = true } diff --git a/src/main/ai-vault/cached-session-list.ts b/src/main/ai-vault/cached-session-list.ts index 56e05f1ab13..414d4370b4e 100644 --- a/src/main/ai-vault/cached-session-list.ts +++ b/src/main/ai-vault/cached-session-list.ts @@ -180,6 +180,7 @@ export async function listAiVaultSessions( limit: args?.limit, unlimited: args?.unlimited, scopePaths: args?.scopePaths ? scope.scanScopePaths : undefined, + scopeOnly: args?.scopeOnly, ...roots }, scanSignal, diff --git a/src/main/ai-vault/runtime-session-scanner.ts b/src/main/ai-vault/runtime-session-scanner.ts index 95d300068d7..85eeb7242db 100644 --- a/src/main/ai-vault/runtime-session-scanner.ts +++ b/src/main/ai-vault/runtime-session-scanner.ts @@ -4,6 +4,7 @@ import { z } from 'zod' import { AI_VAULT_AGENTS, AI_VAULT_SCOPE_PATHS_MAX_COUNT, + boundedAiVaultScopeArgs, type AiVaultListArgs, type AiVaultListResult, type AiVaultSession @@ -87,7 +88,7 @@ export async function scanRuntimeAiVaultSessions( force: args.force, ...(args.afterFingerprint !== undefined ? { afterFingerprint: args.afterFingerprint } : {}), // Cap paths for older hosts too; omitted scope paths lose deep-history coverage, not recent sessions. - scopePaths: args.scopePaths?.slice(0, AI_VAULT_SCOPE_PATHS_MAX_COUNT), + ...boundedAiVaultScopeArgs(args.scopePaths, args.scopeOnly), executionHostId }, options.timeoutMs diff --git a/src/main/ai-vault/session-scanner-scope-discovery.ts b/src/main/ai-vault/session-scanner-scope-discovery.ts index bcbd59b8b4b..f847222cf02 100644 --- a/src/main/ai-vault/session-scanner-scope-discovery.ts +++ b/src/main/ai-vault/session-scanner-scope-discovery.ts @@ -15,6 +15,7 @@ import type { FileWithMtime } from './session-scanner-types' import { extractString, parseJsonObject } from './session-scanner-values' import { scanIssueTextFromError } from './session-scan-issues' import { isMissingTranscriptPathError } from './session-scanner-discovery' +import { noteAiVaultScanFileFound } from './ai-vault-scan-progress' // Limit representative probing when a bucket contains transcripts without cwd records. const REPRESENTATIVE_CWD_LINE_LIMIT = 200 @@ -233,6 +234,12 @@ export async function collectBucketFiles(args: { } const fileStat = await wslGatedStat(path, 'scan', args.signal) throwIfAiVaultScanCancelled(args.signal) + // Scope-only scans don't list cwd-bucket agents recursively, so their file count comes from here. + noteAiVaultScanFileFound(args.signal, args.agent, { + path, + dev: fileStat.dev, + ino: fileStat.ino + }) addBoundedFile(args.collected, args.limit, { path, mtimeMs: fileStat.mtimeMs, diff --git a/src/main/ai-vault/session-scanner-scope-inventory.ts b/src/main/ai-vault/session-scanner-scope-inventory.ts index c0408671123..ae89dd96a2c 100644 --- a/src/main/ai-vault/session-scanner-scope-inventory.ts +++ b/src/main/ai-vault/session-scanner-scope-inventory.ts @@ -20,7 +20,10 @@ import { const TRANSCRIPT_EXTENSIONS = new Set(['.jsonl']) export type CwdBucketInventory = { layout: CwdBucketLayout - directories: string[][] + // With no recency pass behind it, a file whose first lines name no cwd is kept for the parse to place. + scopeOnly: boolean + // checkFiles: the bucket's newest transcripts named no in-scope cwd, so each file is checked on its own. + directories: { paths: string[]; checkFiles: boolean }[] issues: { before: number; issue: AiVaultScanIssue }[] } @@ -37,6 +40,7 @@ type InScopeDiscoveryArgs = { limit: number excludedFilePaths: ReadonlySet issues: AiVaultScanIssue[] + scopeOnly?: boolean signal?: AbortSignal } @@ -54,7 +58,12 @@ export async function inventoryCwdBucketFiles( args: Omit, issueLimit = SCAN_ISSUE_LIMIT ): Promise { - const inventory: CwdBucketInventory = { layout, directories: [], issues: [] } + const inventory: CwdBucketInventory = { + layout, + scopeOnly: args.scopeOnly === true, + directories: [], + issues: [] + } if (args.scopePaths.length === 0 || args.limit <= 0) { return inventory } @@ -82,10 +91,16 @@ export async function inventoryCwdBucketFiles( ) for (const directory of directories) { await yieldScanInventory(index++, args.signal) + let checkFiles = false if (layout.agent === 'claude') { const cwd = await cachedProjectDirCwd(directory, record, layout.agent, args.signal) + // Scope-only has no recency pass behind it, so a name-matched bucket whose newest transcripts + // name no cwd, or another folder sharing the lossy name, is checked file by file instead. if (!inScope(cwd, directory)) { - continue + if (!args.scopeOnly) { + continue + } + checkFiles = true } } const paths: string[] = [] @@ -101,7 +116,7 @@ export async function inventoryCwdBucketFiles( throwIfAiVaultScanCancelled(args.signal) recordRefusal(record, directory, err, layout.agent) } - inventory.directories.push(paths) + inventory.directories.push({ paths, checkFiles }) } } finally { close() @@ -128,14 +143,20 @@ export async function selectCwdBucketFiles( while (inventory.issues[issueIndex]?.before === index) { record(inventory.issues[issueIndex++].issue) } - const paths = inventory.directories[index] - if (!paths) { + const directory = inventory.directories[index] + if (!directory) { break } await collectBucketFiles({ - paths, + paths: directory.paths, agent: layout.agent, - inScope: layout.agent !== 'claude' ? inScope : undefined, + // Parsers keep a transcript's first recorded cwd, which is what this reads. + inScope: + layout.agent === 'claude' && !directory.checkFiles + ? undefined + : inventory.scopeOnly + ? (cwd, path) => cwd === null || inScope(cwd, path) + : inScope, issues: record, collected, limit: args.limit, diff --git a/src/main/ai-vault/session-scanner-scope-only.test.ts b/src/main/ai-vault/session-scanner-scope-only.test.ts new file mode 100644 index 00000000000..1d3076a3c1d --- /dev/null +++ b/src/main/ai-vault/session-scanner-scope-only.test.ts @@ -0,0 +1,174 @@ +import { mkdtemp, mkdir, rm, utimes, writeFile } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { afterEach, describe, expect, it } from 'vitest' +import { scanAiVaultSessions } from './session-scanner' +import { isolatedScanRoots } from './session-scanner-test-fixtures' +import { + aiVaultSessionInScope, + createAiVaultScopeCwdMatcher +} from '../../shared/ai-vault/scanning/ai-vault-scope-cwd-match' + +let tempRoots: string[] = [] + +afterEach(async () => { + await Promise.all(tempRoots.map((root) => rm(root, { recursive: true, force: true }))) + tempRoots = [] +}) + +async function writeClaudeSession(args: { + claudeRoot: string + dirName: string + sessionId: string + cwd: string + iso: string + // Records before the first cwd, like a long run of snapshot or summary lines. + cwdlessLines?: number +}): Promise { + const dir = join(args.claudeRoot, args.dirName) + await mkdir(dir, { recursive: true }) + const records: unknown[] = Array.from({ length: args.cwdlessLines ?? 0 }, () => ({ + type: 'file-history-snapshot', + sessionId: args.sessionId + })) + records.push({ + type: 'user', + sessionId: args.sessionId, + timestamp: args.iso, + cwd: args.cwd, + message: { role: 'user', content: `work in ${args.cwd}` } + }) + const filePath = join(dir, `${args.sessionId}.jsonl`) + await writeFile(filePath, records.map((record) => JSON.stringify(record)).join('\n')) + const time = new Date(args.iso) + await utimes(filePath, time, time) +} + +// What main's Workspace tab shows: the full scan, filtered to the scope as the renderer does. +async function workspaceSessionIds( + root: string, + scopePaths: string[], + options: { scopeOnly?: boolean; limit?: number } +): Promise { + const result = await scanAiVaultSessions({ + ...isolatedScanRoots(root), + platform: 'darwin', + scopePaths, + ...options + }) + const inScope = createAiVaultScopeCwdMatcher(scopePaths) + return result.sessions + .filter((session) => aiVaultSessionInScope(inScope, session)) + .map((session) => session.sessionId) + .sort() +} + +async function tempRoot(): Promise { + const root = await mkdtemp(join(tmpdir(), 'orca-ai-vault-scope-only-')) + tempRoots.push(root) + return root +} + +describe('scanAiVaultSessions scopeOnly', () => { + it('keeps recent sessions whose bucket or first lines name no in-scope cwd', async () => { + const root = await tempRoot() + const claudeRoot = isolatedScanRoots(root).claudeProjectsDir + // The bucket's only transcript records its cwd after the 200 lines the bucket probe reads. + await writeClaudeSession({ + claudeRoot, + dirName: '-repo-app', + sessionId: 'late-cwd', + cwd: '/repo/app', + iso: '2026-06-01T00:00:00.000Z', + cwdlessLines: 250 + }) + // `/repo/my-app` and `/repo/my/app` share one bucket name; the newest transcript is the other folder's. + await writeClaudeSession({ + claudeRoot, + dirName: '-repo-my-app', + sessionId: 'shared-bucket', + cwd: '/repo/my/app', + iso: '2026-06-02T00:00:00.000Z' + }) + await writeClaudeSession({ + claudeRoot, + dirName: '-repo-my-app', + sessionId: 'other-folder', + cwd: '/repo/my-app', + iso: '2026-06-03T00:00:00.000Z' + }) + // CodeBuddy's transcripts are checked one by one; this one also records its cwd late. + const codebuddyDir = join(isolatedScanRoots(root).codebuddyProjectsDir, 'repo-app') + await mkdir(codebuddyDir, { recursive: true }) + await writeFile( + join(codebuddyDir, 'codebuddy-late-cwd.jsonl'), + [ + ...Array.from({ length: 250 }, () => ({ type: 'file-history-snapshot' })), + { + type: 'message', + timestamp: '2026-06-04T00:00:00.000Z', + sessionId: 'codebuddy-late-cwd', + cwd: '/repo/app', + role: 'user', + content: [{ type: 'input_text', text: 'work in /repo/app' }] + } + ] + .map((record) => JSON.stringify(record)) + .join('\n') + ) + const scopePaths = ['/repo/app', '/repo/my/app'] + + const main = await workspaceSessionIds(root, scopePaths, {}) + expect(main).toEqual(['codebuddy-late-cwd', 'late-cwd', 'shared-bucket']) + await expect(workspaceSessionIds(root, scopePaths, { scopeOnly: true })).resolves.toEqual(main) + }) + + it('keeps every in-scope session main shows when the scope holds more than the limit', async () => { + const root = await tempRoot() + const claudeRoot = isolatedScanRoots(root).claudeProjectsDir + for (let index = 0; index < 4; index++) { + await writeClaudeSession({ + claudeRoot, + dirName: '-repo-app', + sessionId: `in-scope-${index}`, + cwd: '/repo/app', + iso: `2026-06-0${index + 1}T00:00:00.000Z` + }) + } + + // Main shows the recency pass's 2 plus the scope pass's 2 more. + const main = await workspaceSessionIds(root, ['/repo/app'], { limit: 2 }) + expect(main).toHaveLength(4) + await expect( + workspaceSessionIds(root, ['/repo/app'], { limit: 2, scopeOnly: true }) + ).resolves.toEqual(main) + }) + + it('returns only in-scope rows', async () => { + const root = await tempRoot() + const claudeRoot = isolatedScanRoots(root).claudeProjectsDir + await writeClaudeSession({ + claudeRoot, + dirName: '-repo-app', + sessionId: 'in-scope', + cwd: '/repo/app', + iso: '2026-06-01T00:00:00.000Z' + }) + await writeClaudeSession({ + claudeRoot, + dirName: '-elsewhere', + sessionId: 'elsewhere', + cwd: '/elsewhere', + iso: '2026-06-02T00:00:00.000Z' + }) + + const result = await scanAiVaultSessions({ + ...isolatedScanRoots(root), + platform: 'darwin', + scopePaths: ['/repo/app'], + scopeOnly: true + }) + + expect(result.sessions.map((session) => session.sessionId)).toEqual(['in-scope']) + }) +}) diff --git a/src/main/ai-vault/session-scanner-scope-walk.ts b/src/main/ai-vault/session-scanner-scope-walk.ts index 41689d6bbcd..9810d80e75b 100644 --- a/src/main/ai-vault/session-scanner-scope-walk.ts +++ b/src/main/ai-vault/session-scanner-scope-walk.ts @@ -33,7 +33,11 @@ import type { SessionFileCandidate, SessionFileDiscovery } from './session-scanner-types' -import { AI_VAULT_SCOPE_CWD_SOURCES, scopeWalksAgentFiles } from './session-scope-cwd' +import { + AI_VAULT_SCOPE_CWD_SOURCES, + scopeOnlyScan, + scopeWalksAgentFiles +} from './session-scope-cwd' import { sidecarUnchanged } from './parse-cache/session-sidecar-stat' import { prioritizeAntigravityTranscriptCandidates } from './scanners/antigravity/antigravity-transcript-candidates' @@ -61,7 +65,8 @@ export async function scanInScopeSessions(args: ScopeScanArgs): Promise discovery.rootDir), scopePaths, limit: args.limit, + scopeOnly: scopeOnlyScan(args.options), signal: args.options.signal }, issueLimit @@ -220,7 +226,7 @@ export async function prepareScopeScan( issueLimit -= inventory.issues.length inventories.push(inventory) if (workload) { - for (const paths of inventory.directories) { + for (const { paths } of inventory.directories) { for (const path of paths) { await yieldScanInventory(index++, args.options.signal) workload.registerPath(source.layout.agent, path, 'bucket') diff --git a/src/main/ai-vault/session-scanner-source-discovery.ts b/src/main/ai-vault/session-scanner-source-discovery.ts index 8a2e8df2d54..3d16e92696c 100644 --- a/src/main/ai-vault/session-scanner-source-discovery.ts +++ b/src/main/ai-vault/session-scanner-source-discovery.ts @@ -7,7 +7,7 @@ import { antigravityDiscoveries } from './scanners/antigravity/session-scanner-a import { AI_VAULT_AGENT_SOURCES, type AiVaultAgentSource } from './session-scanner-agent-sources' import { normalizedWslHomeDirs } from './session-scanner-roots' import { configureOpenCodeWslReaders } from './scanners/opencode/reader-transport/session-scanner-opencode-wsl-client' -import { scopeWalksAgentFiles } from './session-scope-cwd' +import { scopeOnlyScan, scopeWalksAgentFiles } from './session-scope-cwd' import type { AiVaultScanOptions, SessionFileDiscovery } from './session-scanner-types' export { DEFAULT_CODEX_HOME_DIR } from './session-scanner-agent-sources' @@ -51,6 +51,10 @@ function agentDiscoveries( issues: AiVaultScanIssue[] ): Promise[] { const rootDirs = source.rootDirs(options, wslHomeDirs) + // Scope-only scans read cwd-bucket agents through their bucket inventory and can't place cwd-less ones. + if (scopeOnlyScan(options) && !scopeWalksAgentFiles(agent, options.scopePaths)) { + return rootDirs.map(async (rootDir) => ({ agent, rootDir, files: [] })) + } const discover = (rootDir: string): Promise => discoverFiles({ rootDir, diff --git a/src/main/ai-vault/session-scanner-types.ts b/src/main/ai-vault/session-scanner-types.ts index 468615ebb7f..54b7eadcb08 100644 --- a/src/main/ai-vault/session-scanner-types.ts +++ b/src/main/ai-vault/session-scanner-types.ts @@ -59,6 +59,8 @@ export type AiVaultScanOptions = { limitPerAgent?: number // Include sessions for these workspace paths beyond the recency cap (AI_VAULT_SCOPE_CWD_SOURCES). scopePaths?: readonly string[] + // Return only scopePaths sessions, skipping the global recency pass (Workspace and Project). + scopeOnly?: boolean platform?: NodeJS.Platform executionHostId?: ExecutionHostId signal?: AbortSignal diff --git a/src/main/ai-vault/session-scanner.ts b/src/main/ai-vault/session-scanner.ts index ef007200382..0a816662eb2 100644 --- a/src/main/ai-vault/session-scanner.ts +++ b/src/main/ai-vault/session-scanner.ts @@ -26,6 +26,11 @@ import { } from './scanners/cursor/session-scanner-cursor-chat-meta' import type { AiVaultScanOptions } from './session-scanner-types' import { clampPositiveInteger } from './session-scanner-values' +import { scopeOnlyScan } from './session-scope-cwd' +import { + aiVaultSessionInScope, + createAiVaultScopeCwdMatcher +} from '../../shared/ai-vault/scanning/ai-vault-scope-cwd-match' import { throwIfAiVaultScanCancelled } from './ai-vault-scan-cancellation' import { DEFAULT_AI_VAULT_SCAN_LIMIT } from '../../shared/ai-vault/scanning/ai-vault-session-depth' import { withDevinSessionsDbScan } from './scanners/devin/session-scanner-devin-db' @@ -33,7 +38,7 @@ import { withOpenCodeSqliteScanScope } from './scanners/opencode/sqlite/session- const SESSION_PARSE_CANDIDATE_MULTIPLIER = 2 -/** Return recency-capped sessions plus recovered in-scope sessions, deduplicated and sorted. */ +/** Return recency-capped sessions plus recovered in-scope sessions (only those for scopeOnly), deduplicated and sorted. */ export async function scanAiVaultSessions( options: AiVaultScanOptions = {} ): Promise { @@ -92,16 +97,21 @@ async function scanAiVaultSessionStores(options: AiVaultScanOptions): Promise workload?.settle(candidate, 'global', parsed) }) - const cappedSessions = dedupeScannedSessions(parsedSessions) + const recentSessions = dedupeScannedSessions(parsedSessions) .sort((left, right) => sessionSortTime(right) - sessionSortTime(left)) .slice(0, limit) + // Scope-only keeps the recency pass for agents without cwd buckets, but returns only its in-scope rows. + const inScope = createAiVaultScopeCwdMatcher(options.scopePaths ?? []) + const cappedSessions = scopeOnlyScan(options) + ? recentSessions.filter((session) => aiVaultSessionInScope(inScope, session)) + : recentSessions const scopeSessions = await scanInScopeSessions({ inventory, discoveries, options, limit, - alreadyParsedFilePaths: new Set(cappedSessions.map((session) => session.filePath)), + alreadyParsedFilePaths: new Set(recentSessions.map((session) => session.filePath)), platform, executionHostId, issues, diff --git a/src/main/ai-vault/session-scope-cwd.ts b/src/main/ai-vault/session-scope-cwd.ts index 11b337fa5ce..92c4fbc33b3 100644 --- a/src/main/ai-vault/session-scope-cwd.ts +++ b/src/main/ai-vault/session-scope-cwd.ts @@ -6,7 +6,11 @@ import { PI_CWD_BUCKET_LAYOUT, type CwdBucketLayout } from './session-cwd-bucket-layouts' -import type { FileWithMtime, SessionFileCandidate } from './session-scanner-types' +import type { + AiVaultScanOptions, + FileWithMtime, + SessionFileCandidate +} from './session-scanner-types' import { asRecord } from './session-scanner-record-value' import { extractString, parseJsonObject } from './session-scanner-values' import { clineManifestCwd } from './scanners/cline/session-scanner-cline-parser' @@ -146,6 +150,13 @@ export const AI_VAULT_SCOPE_CWD_SOURCES: Record +): boolean { + return options.scopeOnly === true && (options.scopePaths?.length ?? 0) > 0 +} + export function scopeWalksAgentFiles( agent: AiVaultAgent, scopePaths: readonly string[] | undefined diff --git a/src/main/ipc/ai-vault/ai-vault.ts b/src/main/ipc/ai-vault/ai-vault.ts index 007e0cb9188..303166c2cf8 100644 --- a/src/main/ipc/ai-vault/ai-vault.ts +++ b/src/main/ipc/ai-vault/ai-vault.ts @@ -117,7 +117,8 @@ async function listAiVaultSessions( ? [...new Set(scopePaths)].sort() : scopePaths, executionHostScope, - includeAntigravityIdeSessions: args?.includeAntigravityIdeSessions === true + includeAntigravityIdeSessions: args?.includeAntigravityIdeSessions === true, + ...(args?.scopeOnly === true ? { scopeOnly: true } : {}) }) const depth = requestedAiVaultSessionDepth(args) const afterFingerprint = @@ -260,9 +261,7 @@ export function registerAiVaultHandlers(options: AiVaultHandlerOptions = {}): vo const controller = listCancellations.begin(event, requestToken) try { await handlerOptions.ensureStructuredSessionOwnership?.() - const result = await listAiVaultSessions(args, { - signal: controller?.signal - }) + const result = await listAiVaultSessions(args, { signal: controller?.signal }) return projectStructuredAiVaultSessions(result, OPENS_EVERY_STRUCTURED_CHAT) } catch (error) { // Expected cancellation is a result so Electron does not log rejected IPC as an error. diff --git a/src/main/runtime/rpc/methods/history/ai-vault.ts b/src/main/runtime/rpc/methods/history/ai-vault.ts index 54006f3c7af..0ec0a41183c 100644 --- a/src/main/runtime/rpc/methods/history/ai-vault.ts +++ b/src/main/runtime/rpc/methods/history/ai-vault.ts @@ -107,6 +107,7 @@ export const AI_VAULT_METHODS = [ unlimited: params.unlimited, force: params.force, scopePaths: params.scopePaths, + scopeOnly: params.scopeOnly, includeAntigravityIdeSessions: params.includeAntigravityIdeSessions }, signal diff --git a/src/renderer/src/components/right-sidebar/ai-vault/panel/AiVaultPanel.tsx b/src/renderer/src/components/right-sidebar/ai-vault/panel/AiVaultPanel.tsx index 1822a4cd66d..c7cb212c32f 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/panel/AiVaultPanel.tsx +++ b/src/renderer/src/components/right-sidebar/ai-vault/panel/AiVaultPanel.tsx @@ -157,7 +157,7 @@ export default function AiVaultPanel({ scanResult, sessions: history, loadedSessionLimit - } = useAiVaultSessionRefresh(scopePaths, executionHostScope, sessionLimit) + } = useAiVaultSessionRefresh(scopePaths, executionHostScope, sessionLimit, scope !== 'all') // Send scope identity: the host owns project worktree enumeration, and hundreds of paths cannot fit a request. const searchWithin = useMemo( () => @@ -176,6 +176,7 @@ export default function AiVaultPanel({ ) const requestedScanKey = aiVaultLocalScanKey({ scopePaths, + scopeOnly: scope !== 'all', includeAntigravityIdeSessions: true, limit: sessionLimit === 'unlimited' ? undefined : sessionLimit, unlimited: sessionLimit === 'unlimited' diff --git a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-applied-scan.ts b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-applied-scan.ts index 117f34dd2b3..39669f90f66 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-applied-scan.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-applied-scan.ts @@ -8,6 +8,8 @@ export type AiVaultAppliedScan = { result: AiVaultListResult limit: AiVaultSessionLimit scopeKey: string + /** Workspace and Project rows hold only that scope, so they never stand in for another one. */ + scopeOnly: boolean } export function useAppliedAiVaultScan(): { @@ -16,6 +18,7 @@ export function useAppliedAiVaultScan(): { published: AiVaultListResult, limit: AiVaultSessionLimit, scopeKey: string, + scopeOnly: boolean, onApplied?: (result: AiVaultListResult) => void ) => void } { @@ -27,6 +30,7 @@ export function useAppliedAiVaultScan(): { published: AiVaultListResult, limit: AiVaultSessionLimit, scopeKey: string, + scopeOnly: boolean, onApplied?: (result: AiVaultListResult) => void ) => { const previous = acceptedScanRef.current @@ -37,7 +41,7 @@ export function useAppliedAiVaultScan(): { previous.limit === limit && previous.scopeKey === scopeKey ? previous - : { result, limit, scopeKey } + : { result, limit, scopeKey, scopeOnly } acceptedScanRef.current = next setScan(next) onApplied?.(result) diff --git a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-panel-session-list-request.test.tsx b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-panel-session-list-request.test.tsx index 9d48ce79e32..e877f32191f 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-panel-session-list-request.test.tsx +++ b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-panel-session-list-request.test.tsx @@ -27,6 +27,7 @@ import { type PanelRequest = { scopePaths: readonly string[] + scopeOnly: boolean executionHostScope: string sessionLimit: number | 'unlimited' } @@ -53,9 +54,10 @@ vi.mock('./ai-vault-session-refresh', () => ({ useAiVaultSessionRefresh: ( scopePaths: PanelRequest['scopePaths'], executionHostScope: PanelRequest['executionHostScope'], - sessionLimit: PanelRequest['sessionLimit'] + sessionLimit: PanelRequest['sessionLimit'], + scopeOnly: PanelRequest['scopeOnly'] ) => { - panelRequests.push({ scopePaths, executionHostScope, sessionLimit }) + panelRequests.push({ scopePaths, scopeOnly, executionHostScope, sessionLimit }) return { error: null, loading: false, @@ -140,10 +142,12 @@ it.each([false, true])( returned.sessions = [session] const { default: AiVaultPanel } = await import('../panel/AiVaultPanel') render() + expect(panelRequests.at(-1)).toMatchObject({ scopeOnly: true }) expect(panelRequests.at(-1)?.scopePaths).toContain('/var/example') expect(panelRows).toEqual([{ session, resume: { available: true, workspaceId: folderId } }]) expect(panelRows[0].session).toBe(session) fireEvent.click(screen.getByRole('radio', { name: /^All$/ })) + expect(panelRequests.at(-1)).toMatchObject({ scopeOnly: false }) expect(panelRequests.at(-1)?.scopePaths).toContain('/var/example') expect(panelRows).toEqual([{ session, resume: { available: true, workspaceId: folderId } }]) expect(panelRows[0].session.cwd).toBe('/private/var/example') diff --git a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-list-request.ts b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-list-request.ts index 9a88f982743..0f6758bf179 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-list-request.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-list-request.ts @@ -16,6 +16,8 @@ import { /** Match panel requests so readers share host/renderer caches instead of evicting one another. */ export type AiVaultSessionListRequest = { scopePaths: readonly string[] + /** Workspace and Project list only their own sessions; All and the tab move lookup leave it off. */ + scopeOnly?: boolean executionHostScope: ExecutionHostScope sessionLimit: AiVaultSessionLimit } @@ -29,6 +31,7 @@ export function aiVaultSessionListArgs( limit: request.sessionLimit === 'unlimited' ? undefined : request.sessionLimit, unlimited: request.sessionLimit === 'unlimited', scopePaths: request.scopePaths, + ...(request.scopeOnly === true ? { scopeOnly: true } : {}), executionHostScope: request.executionHostScope, force: options.force, requestToken: options.requestToken @@ -39,7 +42,11 @@ export function readCachedAiVaultSessionList( request: AiVaultSessionListRequest ): AiVaultListResult | null { return readCachedAiVaultSessionResult({ - key: aiVaultSessionResultCacheKey(request.executionHostScope, request.scopePaths), + key: aiVaultSessionResultCacheKey( + request.executionHostScope, + request.scopePaths, + request.scopeOnly + ), limit: request.sessionLimit, scopePaths: request.scopePaths }) @@ -51,7 +58,11 @@ export function cacheAiVaultSessionList( options: { replaceHostEntries: boolean } ): void { cacheAiVaultSessionResult({ - key: aiVaultSessionResultCacheKey(request.executionHostScope, request.scopePaths), + key: aiVaultSessionResultCacheKey( + request.executionHostScope, + request.scopePaths, + request.scopeOnly + ), executionHostScope: request.executionHostScope, limit: request.sessionLimit, scopePaths: request.scopePaths, diff --git a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-refresh.test.ts b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-refresh.test.ts index 286044b1e35..1187fe1b90f 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-refresh.test.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-refresh.test.ts @@ -41,11 +41,13 @@ function HookProbe(props: { scopePaths: readonly string[] executionHostScope?: ExecutionHostScope sessionLimit?: AiVaultSessionLimit + scopeOnly?: boolean }): null { latest = useAiVaultSessionRefresh( props.scopePaths, props.executionHostScope ?? 'local', - props.sessionLimit ?? DEFAULT_AI_VAULT_SESSION_LIMIT + props.sessionLimit ?? DEFAULT_AI_VAULT_SESSION_LIMIT, + props.scopeOnly ?? false ) return null } @@ -53,28 +55,34 @@ function HookProbe(props: { async function renderHook( scopePaths: readonly string[] = [], executionHostScope: ExecutionHostScope = 'local', - sessionLimit: AiVaultSessionLimit = DEFAULT_AI_VAULT_SESSION_LIMIT + sessionLimit: AiVaultSessionLimit = DEFAULT_AI_VAULT_SESSION_LIMIT, + scopeOnly = false ): Promise { const container = document.createElement('div') document.body.appendChild(container) const root = createRoot(container) roots.push(root) await act(async () => { - root.render(createElement(HookProbe, { scopePaths, executionHostScope, sessionLimit })) + root.render( + createElement(HookProbe, { scopePaths, executionHostScope, sessionLimit, scopeOnly }) + ) }) } async function rerenderHook( scopePaths: readonly string[] = [], executionHostScope: ExecutionHostScope = 'local', - sessionLimit: AiVaultSessionLimit = DEFAULT_AI_VAULT_SESSION_LIMIT + sessionLimit: AiVaultSessionLimit = DEFAULT_AI_VAULT_SESSION_LIMIT, + scopeOnly = false ): Promise { const root = roots.at(-1) if (!root) { throw new Error('renderHook must be called before rerenderHook') } await act(async () => { - root.render(createElement(HookProbe, { scopePaths, executionHostScope, sessionLimit })) + root.render( + createElement(HookProbe, { scopePaths, executionHostScope, sessionLimit, scopeOnly }) + ) }) } @@ -198,6 +206,29 @@ describe('useAiVaultSessionRefresh refocus behavior', () => { expect(latest?.scanResult?.scannedAt).toBe('2026-07-01T00:00:02.000Z') }) + it('does not show Workspace-only rows under All while All loads or after it fails', async () => { + let failAll: (error: Error) => void = () => {} + listSessionsMock.mockImplementation((args) => + args.scopeOnly + ? Promise.resolve({ ...EMPTY_RESULT, sessions: [makeVaultSession(1)] }) + : new Promise((_resolve, reject) => { + failAll = reject + }) + ) + await renderHook(['/repo'], 'local', 250, true) + await flushMicrotasks() + expect(latest?.sessions.map((session) => session.id)).toEqual(['session-1']) + + await rerenderHook(['/repo'], 'local', 250, false) + await flushMicrotasks() + expect(latest?.sessions).toEqual([]) + expect(latest?.loading).toBe(true) + + await act(async () => failAll(new Error('scan failed'))) + await flushMicrotasks() + expect(latest?.sessions).toEqual([]) + }) + it('replaces a stuck scan on manual Refresh without cancelling an automatic rescan', async () => { let resolveInitial: ((result: AiVaultListResult) => void) | null = null let resolveReplacement: ((result: AiVaultListResult) => void) | null = null diff --git a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-refresh.ts b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-refresh.ts index 5a4e7f54e33..8fc0d33e194 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-refresh.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-refresh.ts @@ -50,7 +50,8 @@ type AiVaultRefreshArgs = { force?: boolean; background?: boolean; reuseLoadedDe export function useAiVaultSessionRefresh( scopePaths: readonly string[], executionHostScope: ExecutionHostScope, - sessionLimit: AiVaultSessionLimit + sessionLimit: AiVaultSessionLimit, + scopeOnly = false ): { error: string | null loading: boolean @@ -64,8 +65,6 @@ export function useAiVaultSessionRefresh( const { scan, applyScan } = useAppliedAiVaultScan() const associations = useAiVaultAssociationObservation(executionHostScope) const associationsRef = useRef(associations) - const scanResult = scan?.result ?? null - const sessions = scanResult?.sessions ?? EMPTY_AI_VAULT_SESSIONS const [loading, setLoading] = useState(false) const [failure, setFailure] = useState<{ scopeKey: string; cause: string } | null>(null) const [terminalScopeKey, setTerminalScopeKey] = useState(null) @@ -82,24 +81,29 @@ export function useAiVaultSessionRefresh( const mountedRef = useRef(true) const publicationGateRef = useRef(undefined!) publicationGateRef.current ??= new AiVaultSessionPublicationGate() - const scanScopeKey = `${aiVaultSessionResultCacheKey(executionHostScope, scopePaths)}\n${sessionLimit}` + const scanScopeKey = `${aiVaultSessionResultCacheKey(executionHostScope, scopePaths, scopeOnly)}\n${sessionLimit}` + // Another scope's scope-only rows would pass for this scope's list while it loads or after it fails. + const shown = scan && (!scan.scopeOnly || scan.scopeKey === scanScopeKey) ? scan : null // Kept through rescans so a repeat failure doesn't blink; shown only for the scope that failed. const error = failure?.scopeKey === scanScopeKey ? aiVaultScanErrorText(failure.cause) : null const scopePathsRef = useRef(scopePaths) scopePathsRef.current = scopePaths + const scopeOnlyRef = useRef(scopeOnly) const executionHostScopeRef = useRef(executionHostScope) executionHostScopeRef.current = executionHostScope const sessionLimitRef = useRef(sessionLimit) // Keep render pure for React Doctor; layout effect still lands before refresh effects. useLayoutEffect(() => { sessionLimitRef.current = sessionLimit + scopeOnlyRef.current = scopeOnly associationsRef.current = associations - }, [associations, sessionLimit]) + }, [associations, scopeOnly, sessionLimit]) const currentScanScopeKey = useCallback( () => `${aiVaultSessionResultCacheKey( executionHostScopeRef.current, - scopePathsRef.current + scopePathsRef.current, + scopeOnlyRef.current )}\n${sessionLimitRef.current}`, [] ) @@ -111,15 +115,15 @@ export function useAiVaultSessionRefresh( observation === associationsRef.current && associationRevision === observation.getSnapshot() const hostScope = executionHostScopeRef.current const selectedLimit = sessionLimitRef.current - const baseKey = aiVaultSessionResultCacheKey(hostScope, scopePathsRef.current) + const request = { + scopePaths: scopePathsRef.current, + scopeOnly: scopeOnlyRef.current, + executionHostScope: hostScope, + sessionLimit: selectedLimit + } + const baseKey = aiVaultSessionResultCacheKey(hostScope, request.scopePaths, request.scopeOnly) const cachedResult = - args.reuseLoadedDepth === true - ? readCachedAiVaultSessionList({ - scopePaths: scopePathsRef.current, - executionHostScope: hostScope, - sessionLimit: selectedLimit - }) - : null + args.reuseLoadedDepth === true ? readCachedAiVaultSessionList(request) : null if (cachedResult) { const scanKey = `${baseKey}\n${selectedLimit}` setFailure(null) @@ -128,7 +132,7 @@ export function useAiVaultSessionRefresh( if (!mountedRef.current || scanKey !== currentScanScopeKey() || !associationCurrent()) { return } - applyScan(published, selectedLimit, scanKey, (applied) => { + applyScan(published, selectedLimit, scanKey, request.scopeOnly, (applied) => { conditionalSnapshotRef.current = published.fingerprint ? { scopeKey: scanKey, fingerprint: published.fingerprint, result: applied } : null @@ -167,11 +171,6 @@ export function useAiVaultSessionRefresh( refreshIdRef.current === refreshId && scanKey === currentScanScopeKey() && associationCurrent() - const request = { - scopePaths: scopePathsRef.current, - executionHostScope: hostScope, - sessionLimit: selectedLimit - } try { const previous = conditionalSnapshotRef.current const result = await refreshAiVaultSessionList( @@ -191,7 +190,7 @@ export function useAiVaultSessionRefresh( cacheAiVaultSessionList(request, result, { replaceHostEntries: args.force === true }) publicationGateRef.current.publish(result, (published) => { if (requestCurrent()) { - applyScan(published, selectedLimit, scanKey, (applied) => { + applyScan(published, selectedLimit, scanKey, request.scopeOnly, (applied) => { conditionalSnapshotRef.current = published.fingerprint ? { scopeKey: scanKey, fingerprint: published.fingerprint, result: applied } : null @@ -322,8 +321,8 @@ export function useAiVaultSessionRefresh( loading: loading || scopePending, scopePending, refresh, - scanResult, - sessions, - loadedSessionLimit: scan?.limit ?? null + scanResult: shown?.result ?? null, + sessions: shown?.result.sessions ?? EMPTY_AI_VAULT_SESSIONS, + loadedSessionLimit: shown?.limit ?? null } } diff --git a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-result-cache.ts b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-result-cache.ts index b528019333a..256f60fd512 100644 --- a/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-result-cache.ts +++ b/src/renderer/src/components/right-sidebar/ai-vault/scanning/ai-vault-session-result-cache.ts @@ -18,10 +18,15 @@ const cachedSessionResults = new Map() export function aiVaultSessionResultCacheKey( executionHostScope: ExecutionHostScope, - scopePaths: readonly string[] + scopePaths: readonly string[], + scopeOnly = false ): string { // JSON keeps the parts unambiguous: a path may legally contain any separator. - return JSON.stringify([executionHostScope, ...[...new Set(scopePaths)].sort()]) + return JSON.stringify([ + executionHostScope, + ...(scopeOnly ? [{ scopeOnly }] : []), + ...[...new Set(scopePaths)].sort() + ]) } export function readCachedAiVaultSessionResult(args: { diff --git a/src/renderer/src/web/preload-api/web-ai-vault-api.ts b/src/renderer/src/web/preload-api/web-ai-vault-api.ts index 138304d436d..a2359550941 100644 --- a/src/renderer/src/web/preload-api/web-ai-vault-api.ts +++ b/src/renderer/src/web/preload-api/web-ai-vault-api.ts @@ -76,6 +76,7 @@ export function createWebAiVaultApi(): NonNullable['aiVault' ? { afterFingerprint: args.afterFingerprint } : {}), scopePaths: args?.scopePaths, + ...(args?.scopeOnly === true ? { scopeOnly: true } : {}), executionHostId }).then((result) => // Fence later host mutations on these rows to the pairing that listed them. diff --git a/src/shared/ai-vault/contracts/ai-vault-types.ts b/src/shared/ai-vault/contracts/ai-vault-types.ts index 3ef4abbf830..25d6ccff17a 100644 --- a/src/shared/ai-vault/contracts/ai-vault-types.ts +++ b/src/shared/ai-vault/contracts/ai-vault-types.ts @@ -237,10 +237,27 @@ export type AiVaultListArgs = { force?: boolean // Scope paths preserve older relevant sessions outside the globally recency-capped result. scopePaths?: readonly string[] + /** Return only scopePaths sessions, without the global recency pass. Older hosts ignore it; clients still filter. */ + scopeOnly?: boolean executionHostScope?: ExecutionHostScope requestToken?: string } +/** Cap scope paths for a host; a capped scope can't answer alone, so it drops scopeOnly. */ +export function boundedAiVaultScopeArgs( + scopePaths: readonly string[] | undefined, + scopeOnly: boolean | undefined +): Pick { + if (!scopePaths) { + return {} + } + return scopeOnly === true && + scopePaths.length > 0 && + scopePaths.length <= AI_VAULT_SCOPE_PATHS_MAX_COUNT + ? { scopePaths, scopeOnly: true } + : { scopePaths: scopePaths.slice(0, AI_VAULT_SCOPE_PATHS_MAX_COUNT) } +} + export type AiVaultListResult = { /** Local scan entry that produced this result; absent for remote and merged results. */ scanId?: string diff --git a/src/shared/ai-vault/scanning/ai-vault-local-scan-key.ts b/src/shared/ai-vault/scanning/ai-vault-local-scan-key.ts index 5aa1852ecba..f605ed4f34b 100644 --- a/src/shared/ai-vault/scanning/ai-vault-local-scan-key.ts +++ b/src/shared/ai-vault/scanning/ai-vault-local-scan-key.ts @@ -12,6 +12,8 @@ export function aiVaultLocalScanKey(args?: AiVaultListArgs): string { export function aiVaultLocalScanScopeKey(args?: AiVaultListArgs): string { return JSON.stringify({ scopePaths: [...new Set(args?.scopePaths ?? [])].sort(), - includeAntigravityIdeSessions: args?.includeAntigravityIdeSessions === true + includeAntigravityIdeSessions: args?.includeAntigravityIdeSessions === true, + // A scope-only result lacks the newest sessions elsewhere, so it never serves a full request. + ...(args?.scopeOnly === true ? { scopeOnly: true } : {}) }) } diff --git a/src/shared/rpc-contract/ai-vault-params.ts b/src/shared/rpc-contract/ai-vault-params.ts index e1414365608..0c113761afb 100644 --- a/src/shared/rpc-contract/ai-vault-params.ts +++ b/src/shared/rpc-contract/ai-vault-params.ts @@ -1,9 +1,6 @@ import { z } from 'zod' import { parseExecutionHostId } from '../execution-host' -import { - AI_VAULT_AGENTS, - AI_VAULT_SCOPE_PATHS_MAX_COUNT -} from '../ai-vault/contracts/ai-vault-types' +import { AI_VAULT_AGENTS, boundedAiVaultScopeArgs } from '../ai-vault/contracts/ai-vault-types' import { OptionalBoolean } from './rpc-param-primitives' import { AI_VAULT_SESSION_TITLE_REQUEST_MAX_COUNT } from '../ai-vault/contracts/ai-vault-session-title' @@ -41,11 +38,8 @@ export const AiVaultListSessionsParams = z .regex(/^[0-9a-f]{64}$/) .nullable() .optional(), - scopePaths: z - .array(z.string().min(1).max(AI_VAULT_SCOPE_PATH_MAX_LENGTH)) - // Clamp to preserve older uncapped clients; scopes only widen discovery. - .transform((paths) => paths.slice(0, AI_VAULT_SCOPE_PATHS_MAX_COUNT)) - .optional(), + scopePaths: z.array(z.string().min(1).max(AI_VAULT_SCOPE_PATH_MAX_LENGTH)).optional(), + scopeOnly: OptionalBoolean, // Host ID only restamps cached results; desktop/web send it, mobile omits it. Scanning stays host-local. executionHostId: executionHostIdSchema.optional() }) @@ -54,6 +48,11 @@ export const AiVaultListSessionsParams = z ctx.addIssue({ code: 'custom', path: ['limit'], message: 'Limit exceeds maximum' }) } }) + // Clamp to preserve older uncapped clients; scopes only widen discovery. + .transform(({ scopePaths, scopeOnly, ...params }) => ({ + ...params, + ...boundedAiVaultScopeArgs(scopePaths, scopeOnly) + })) const AiVaultRowResumeParams = z .object({