test: remove low-value suites, recorder snapshots, and repeated inputs (#41244)

* test: remove weak recorder scenarios and arithmetic suites

* test: remove low-value boundary suites and recorder cases

* test: remove mock suites and trim repetitive boundary inputs

* test: remove shallow provider and browser checks

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
OrcaWin
2026-11-11 14:14:48 -08:00
committed by GitHub
co-authored by OrcaWin
parent 33a3cd3b1f
commit b1106ba883
52 changed files with 93 additions and 5002 deletions
@@ -2719,9 +2719,7 @@
"src/main/pi/managed-extensions/agent-status/agent-status-extension-session-change.test.ts": 613,
"src/main/pi/managed-extensions/agent-status/agent-status-input-redaction.test.ts": 573,
"src/main/pi/managed-extensions/agent-status/omp-model-command-source.test.ts": 640,
"src/main/pi/rpc/launch/rpc-launch.test.ts": 305,
"src/main/pi/rpc/prompts/rpc-prompt-delivery.test.ts": 204,
"src/main/pi/rpc/prompts/rpc-prompt.test.ts": 228,
"src/main/pi/rpc/rpc-session-rename.test.ts": 1172,
"src/main/pi/rpc/rpc-session-startup.test.ts": 4955,
"src/main/pi/rpc/rpc-turn-races.test.ts": 2191,
@@ -4571,7 +4569,6 @@
"src/renderer/src/components/editor/image-png-export.chromium.test.ts": 212,
"src/renderer/src/components/editor/image-png-export.test.ts": 50,
"src/renderer/src/components/editor/image-viewer-zoom-ownership.test.tsx": 2268,
"src/renderer/src/components/editor/image-viewer-zoom.test.ts": 47,
"src/renderer/src/components/editor/notebook/kernel/ipynb-kernel-outputs.test.ts": 307,
"src/renderer/src/components/editor/notebook/kernel/ipynb-kernel-session-start-lifetime.test.ts": 140,
"src/renderer/src/components/editor/notebook/kernel/ipynb-kernel-session.test.ts": 180,
@@ -4710,7 +4707,6 @@
"src/renderer/src/components/emulator-pane/use-emulator-pane-session.test.tsx": 1968,
"src/renderer/src/components/emulator-pane/use-mobile-emulator-tab-intro-actions.test.tsx": 1828,
"src/renderer/src/components/feature-tips/ChatUiHereFeatureTipVisual.test.tsx": 1093,
"src/renderer/src/components/feature-tips/feature-tip-modal-state.test.ts": 244,
"src/renderer/src/components/feature-wall/FeatureWallSetupWorkflowActions.test.tsx": 2028,
"src/renderer/src/components/feature-wall/FullDiskAccessSetupPrompt.test.ts": 466,
"src/renderer/src/components/floating-terminal/floating-workspace-tab-reorder.test.ts": 2520,
@@ -4720,7 +4716,6 @@
"src/renderer/src/components/github-item-dialog/load-item-details/use-github-item-dialog-details.test.tsx": 2850,
"src/renderer/src/components/github-item-dialog/load-item-details/use-github-task-refresh.test.tsx": 1070,
"src/renderer/src/components/github-item-dialog/open-dialog/github-item-dialog.task-record.test.tsx": 1391,
"src/renderer/src/components/github-project/GhAuthErrorHelp.test.ts": 479,
"src/renderer/src/components/github-project/ProjectBoard.test.tsx": 988,
"src/renderer/src/components/github-project/github-project-picker-filter.test.ts": 53,
"src/renderer/src/components/github-project/group-sort.test.ts": 75,
@@ -5086,7 +5081,6 @@
"src/renderer/src/components/settings/runtime-environments/pairing/RuntimePairingGeneratorForm.test.tsx": 461,
"src/renderer/src/components/settings/appearance/fonts/FontAutocomplete.test.tsx": 1202,
"src/renderer/src/components/settings/form-controls/SettingsFormControls.segmented-control.test.tsx": 730,
"src/renderer/src/components/settings/shortcuts/ShortcutFilterRail.test.ts": 273,
"src/renderer/src/components/settings/shortcuts/ShortcutsPane.provenance.test.tsx": 2302,
"src/renderer/src/components/settings/repository/worktrees/SparsePresetSettingsSection.test.tsx": 744,
"src/renderer/src/components/settings/ssh/server-actions/SshHostDeltaMoveDialog.test.tsx": 438,
@@ -12,25 +12,11 @@ it('keeps byte-compared artifacts and source LF in an autocrlf checkout', () =>
const crlf = 'first\r\nsecond\r\n'
const paths = new Map([
['resources/skills/current-manifest.json', lf],
['src/main/__snapshots__/example.test.ts.snap', lf],
['src/renderer/src/example.tsx', lf],
['src/main/example.ts', lf],
['config/scripts/example.mjs', lf],
['config/scripts/nested/deeper/example.mjs', lf],
['skill-guides/example.md', lf],
['skill-stubs/example.md', lf],
['skill-stubs/_shared/example.md', lf],
['skills/example/SKILL.md', lf],
['src/cli/bundled-skill-guides.ts', lf],
...['cmd', 'bat', 'ps1', 'nsh'].map((extension) => [`config/example.${extension}`, crlf]),
['config/example.cmd', crlf],
['resources/skills-extra/example.json', crlf],
['vendor/resources/skills/example.json', crlf],
['scripts/example.mjs', crlf],
['config/scripts-extra/example.mjs', crlf],
['vendor/config/scripts/example.mjs', crlf],
['config/scripts/example.mjsx', crlf],
['src/main/runtime/__fixtures__/example.txt', crlf],
['src/main/daemon/__fixtures__/pty-transcripts/example.txt', crlf]
['src/main/runtime/__fixtures__/example.txt', crlf]
])
const git = (args) => execFileSync('git', args, { cwd: root, stdio: 'pipe' })
@@ -1,83 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.native-chat-readability",
"family": "session.native-chat-readability",
"namedDeltas": [],
"values": {
"19b2979d7fc2": {
"name": "repo.list#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"repo.list\"}"
},
"70e0675ab2a9": {
"name": "repo.list#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "repo.list"
},
{
"name": "params",
"value": {
"$rpc": "absent"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"repos": [
{
"connectionId": {
"$rpc": "null"
},
"id": "repo-1"
}
]
}
}
}
},
"dcf89ce6b4ca": {
"readable": true,
"worktreeId": "repo-1::/w"
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "native-chat-readability-local-repo",
"checkpoints": [
{
"id": "readable",
"observation": {
"sender": ["70e0675ab2a9"],
"payloads": ["19b2979d7fc2"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "dcf89ce6b4ca",
"effects": []
}
}
]
}
}
@@ -1,77 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.native-chat-readability",
"family": "session.native-chat-readability",
"namedDeltas": [],
"values": {
"0b8777edb86c": {
"readable": false,
"worktreeId": "repo-1::/w"
},
"19b2979d7fc2": {
"name": "repo.list#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"repo.list\"}"
},
"6a68d9e91bc8": {
"name": "repo.list#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "repo.list"
},
{
"name": "params",
"value": {
"$rpc": "absent"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"error": {
"code": "internal",
"message": "Scan failed"
},
"id": "frame-1",
"ok": false
}
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "native-chat-readability-refused",
"checkpoints": [
{
"id": "unreadable",
"observation": {
"sender": ["6a68d9e91bc8"],
"payloads": ["19b2979d7fc2"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "0b8777edb86c",
"effects": []
}
}
]
}
}
@@ -1,81 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.native-chat-readability",
"family": "session.native-chat-readability",
"namedDeltas": [],
"values": {
"0b8777edb86c": {
"readable": false,
"worktreeId": "repo-1::/w"
},
"19b2979d7fc2": {
"name": "repo.list#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"repo.list\"}"
},
"7023dde78391": {
"name": "repo.list#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "repo.list"
},
{
"name": "params",
"value": {
"$rpc": "absent"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"repos": [
{
"connectionId": "ssh-1",
"id": "repo-1"
}
]
}
}
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "native-chat-readability-remote-repo",
"checkpoints": [
{
"id": "unreadable",
"observation": {
"sender": ["7023dde78391"],
"payloads": ["19b2979d7fc2"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "0b8777edb86c",
"effects": []
}
}
]
}
}
@@ -1,209 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.create-terminal",
"family": "session.create-terminal",
"namedDeltas": [],
"values": {
"0dec6eece95b": {
"name": "agent.launchReplay#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "agent.launchReplay"
},
{
"name": "params",
"value": {
"agent": "claude",
"operationId": "1767225600000-00000000000040008000000000000004",
"paneKey": "00000000-0000-4000-8000-000000000001:00000000-0000-4000-8000-000000000002",
"sessionId": "claude_00000000_0000_4000_8000_000000000003",
"target": {
"kind": "existing",
"worktree": "id:wt-1"
}
}
},
{
"name": "options",
"value": {
"$rpc": "undefined"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"outcome": {
"handle": "h-1",
"kind": "structured",
"sessionId": "claude_s1"
},
"receipt": {
"detail": "Started a terminal agent.",
"mode": "structured",
"preferred": "structured",
"reason": "user_default"
},
"worktreeId": "wt-1"
}
}
}
},
"4e536fd51d5d": {
"name": "agent.launchReplay#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"agent.launchReplay\",\"params\":{\"agent\":\"claude\",\"operationId\":\"1767225600000-00000000000040008000000000000004\",\"target\":{\"kind\":\"existing\",\"worktree\":\"id:wt-1\"},\"paneKey\":\"00000000-0000-4000-8000-000000000001:00000000-0000-4000-8000-000000000002\",\"sessionId\":\"claude_00000000_0000_4000_8000_000000000003\"}}"
},
"58c784334dd1": {
"activeHandle": "terminal-0",
"activeSessionTabId": "tab-0",
"createError": "",
"creating": false,
"initializedHandles": ["terminal-0"],
"pendingSelection": {
"kind": "launched",
"lock": "mobile-create:mjuohs00-8ig2hens",
"snapshotsLeft": 5,
"surface": {
"handle": {
"$rpc": "null"
},
"pane": {
"leafId": "00000000-0000-4000-8000-000000000002",
"tabId": "00000000-0000-4000-8000-000000000001"
},
"sessionId": "claude_s1"
}
},
"sessionTabs": [],
"terminals": []
},
"6248a3dd0710": {
"name": "fetch-session-tabs",
"ordinal": 3,
"value": {}
},
"9270aeb7d9c6": {
"status": "pending",
"startedAt": 0
},
"c7778ace6ed5": {
"name": "agent.launchReplay#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "agent.launchReplay"
},
{
"name": "params",
"value": {
"agent": "claude",
"operationId": "1767225600000-00000000000040008000000000000004",
"paneKey": "00000000-0000-4000-8000-000000000001:00000000-0000-4000-8000-000000000002",
"sessionId": "claude_00000000_0000_4000_8000_000000000003",
"target": {
"kind": "existing",
"worktree": "id:wt-1"
}
}
},
{
"name": "options",
"value": {
"$rpc": "undefined"
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
},
"f6051f871c2d": {
"activeHandle": "terminal-0",
"activeSessionTabId": "tab-0",
"createError": "",
"creating": true,
"initializedHandles": ["terminal-0"],
"pendingSelection": {
"kind": "launched",
"lock": "mobile-create:mjuohs00-8ig2hens",
"snapshotsLeft": {
"$rpc": "null"
},
"surface": {
"handle": {
"$rpc": "null"
},
"pane": {
"leafId": "00000000-0000-4000-8000-000000000002",
"tabId": "00000000-0000-4000-8000-000000000001"
},
"sessionId": "claude_00000000_0000_4000_8000_000000000003"
}
},
"sessionTabs": [],
"terminals": []
}
},
"recording": {
"scenario": "session-create-terminal-agent-launched-as-chat",
"checkpoints": [
{
"id": "creating",
"observation": {
"sender": ["c7778ace6ed5"],
"payloads": ["4e536fd51d5d"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "9270aeb7d9c6"
},
"state": "f6051f871c2d",
"effects": []
}
},
{
"id": "launched",
"observation": {
"sender": ["0dec6eece95b"],
"payloads": ["4e536fd51d5d"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "eb79a9b3682a"
},
"state": "58c784334dd1",
"effects": ["6248a3dd0710"]
}
},
{
"id": "tabs-refreshed",
"observation": {
"sender": ["0dec6eece95b"],
"payloads": ["4e536fd51d5d"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "eb79a9b3682a"
},
"state": "58c784334dd1",
"effects": ["6248a3dd0710"]
}
}
]
}
}
@@ -1,206 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.create-terminal",
"family": "session.create-terminal",
"namedDeltas": [],
"values": {
"4e536fd51d5d": {
"name": "agent.launchReplay#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"agent.launchReplay\",\"params\":{\"agent\":\"claude\",\"operationId\":\"1767225600000-00000000000040008000000000000004\",\"target\":{\"kind\":\"existing\",\"worktree\":\"id:wt-1\"},\"paneKey\":\"00000000-0000-4000-8000-000000000001:00000000-0000-4000-8000-000000000002\",\"sessionId\":\"claude_00000000_0000_4000_8000_000000000003\"}}"
},
"5bc4a173d7eb": {
"activeHandle": "terminal-0",
"activeSessionTabId": "tab-0",
"createError": "",
"creating": false,
"initializedHandles": ["terminal-0"],
"pendingSelection": {
"kind": "launched",
"lock": "mobile-create:mjuohs00-8ig2hens",
"snapshotsLeft": 5,
"surface": {
"handle": "terminal-1",
"pane": {
"leafId": "00000000-0000-4000-8000-000000000002",
"tabId": "00000000-0000-4000-8000-000000000001"
},
"sessionId": "claude_00000000_0000_4000_8000_000000000003"
}
},
"sessionTabs": [],
"terminals": []
},
"6248a3dd0710": {
"name": "fetch-session-tabs",
"ordinal": 3,
"value": {}
},
"9270aeb7d9c6": {
"status": "pending",
"startedAt": 0
},
"b686ad3ebac0": {
"name": "agent.launchReplay#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "agent.launchReplay"
},
{
"name": "params",
"value": {
"agent": "claude",
"operationId": "1767225600000-00000000000040008000000000000004",
"paneKey": "00000000-0000-4000-8000-000000000001:00000000-0000-4000-8000-000000000002",
"sessionId": "claude_00000000_0000_4000_8000_000000000003",
"target": {
"kind": "existing",
"worktree": "id:wt-1"
}
}
},
{
"name": "options",
"value": {
"$rpc": "undefined"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"outcome": {
"handle": "terminal-1",
"kind": "terminal"
},
"receipt": {
"detail": "Started a terminal agent.",
"mode": "terminal",
"preferred": "terminal",
"reason": "user_default"
},
"worktreeId": "wt-1"
}
}
}
},
"c7778ace6ed5": {
"name": "agent.launchReplay#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "agent.launchReplay"
},
{
"name": "params",
"value": {
"agent": "claude",
"operationId": "1767225600000-00000000000040008000000000000004",
"paneKey": "00000000-0000-4000-8000-000000000001:00000000-0000-4000-8000-000000000002",
"sessionId": "claude_00000000_0000_4000_8000_000000000003",
"target": {
"kind": "existing",
"worktree": "id:wt-1"
}
}
},
{
"name": "options",
"value": {
"$rpc": "undefined"
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
},
"f6051f871c2d": {
"activeHandle": "terminal-0",
"activeSessionTabId": "tab-0",
"createError": "",
"creating": true,
"initializedHandles": ["terminal-0"],
"pendingSelection": {
"kind": "launched",
"lock": "mobile-create:mjuohs00-8ig2hens",
"snapshotsLeft": {
"$rpc": "null"
},
"surface": {
"handle": {
"$rpc": "null"
},
"pane": {
"leafId": "00000000-0000-4000-8000-000000000002",
"tabId": "00000000-0000-4000-8000-000000000001"
},
"sessionId": "claude_00000000_0000_4000_8000_000000000003"
}
},
"sessionTabs": [],
"terminals": []
}
},
"recording": {
"scenario": "session-create-terminal-agent-launched",
"checkpoints": [
{
"id": "creating",
"observation": {
"sender": ["c7778ace6ed5"],
"payloads": ["4e536fd51d5d"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "9270aeb7d9c6"
},
"state": "f6051f871c2d",
"effects": []
}
},
{
"id": "launched",
"observation": {
"sender": ["b686ad3ebac0"],
"payloads": ["4e536fd51d5d"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "eb79a9b3682a"
},
"state": "5bc4a173d7eb",
"effects": ["6248a3dd0710"]
}
},
{
"id": "tabs-refreshed",
"observation": {
"sender": ["b686ad3ebac0"],
"payloads": ["4e536fd51d5d"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "eb79a9b3682a"
},
"state": "5bc4a173d7eb",
"effects": ["6248a3dd0710"]
}
}
]
}
}
@@ -1,230 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.create-terminal",
"family": "session.create-terminal",
"namedDeltas": [],
"values": {
"0e3a24adf091": {
"name": "toast",
"ordinal": 4,
"value": {
"durationMs": {
"$rpc": "null"
},
"message": "Notes sent"
}
},
"553cfc6cdea5": {
"activeHandle": "terminal-0",
"activeSessionTabId": "tab-0",
"createError": "",
"creating": true,
"initializedHandles": ["terminal-0"],
"pendingSelection": {
"kind": "launched",
"lock": "mobile-create:mjuohs00-8ig2hens",
"snapshotsLeft": {
"$rpc": "null"
},
"surface": {
"handle": {
"$rpc": "null"
},
"pane": {
"leafId": "00000000-0000-4000-8000-000000000002",
"tabId": "00000000-0000-4000-8000-000000000001"
},
"sessionId": "codex_00000000_0000_4000_8000_000000000003"
}
},
"sessionTabs": [],
"terminals": []
},
"6248a3dd0710": {
"name": "fetch-session-tabs",
"ordinal": 3,
"value": {}
},
"73449f52ee06": {
"activeHandle": "terminal-0",
"activeSessionTabId": "tab-0",
"createError": "",
"creating": false,
"initializedHandles": ["terminal-0"],
"pendingSelection": {
"kind": "launched",
"lock": "mobile-create:mjuohs00-8ig2hens",
"snapshotsLeft": 5,
"surface": {
"handle": "terminal-1",
"pane": {
"leafId": "00000000-0000-4000-8000-000000000002",
"tabId": "00000000-0000-4000-8000-000000000001"
},
"sessionId": "codex_00000000_0000_4000_8000_000000000003"
}
},
"sessionTabs": [],
"terminals": []
},
"79b24f8555fe": {
"name": "agent.launchReplay#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "agent.launchReplay"
},
{
"name": "params",
"value": {
"agent": "codex",
"launchSource": "diff_notes_send",
"operationId": "1767225600000-00000000000040008000000000000004",
"paneKey": "00000000-0000-4000-8000-000000000001:00000000-0000-4000-8000-000000000002",
"prompt": {
"delivery": "submit",
"text": "review these notes"
},
"sessionId": "codex_00000000_0000_4000_8000_000000000003",
"target": {
"kind": "existing",
"worktree": "id:wt-1"
}
}
},
{
"name": "options",
"value": {
"timeoutMs": 90000
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"outcome": {
"handle": "terminal-1",
"kind": "terminal"
},
"prompt": {
"delivery": "submit",
"outcome": "handed-to-terminal"
},
"receipt": {
"detail": "Started a terminal agent.",
"mode": "terminal",
"preferred": "terminal",
"reason": "user_default"
},
"worktreeId": "wt-1"
}
}
}
},
"9270aeb7d9c6": {
"status": "pending",
"startedAt": 0
},
"ad660413fab0": {
"name": "agent.launchReplay#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "agent.launchReplay"
},
{
"name": "params",
"value": {
"agent": "codex",
"launchSource": "diff_notes_send",
"operationId": "1767225600000-00000000000040008000000000000004",
"paneKey": "00000000-0000-4000-8000-000000000001:00000000-0000-4000-8000-000000000002",
"prompt": {
"delivery": "submit",
"text": "review these notes"
},
"sessionId": "codex_00000000_0000_4000_8000_000000000003",
"target": {
"kind": "existing",
"worktree": "id:wt-1"
}
}
},
{
"name": "options",
"value": {
"timeoutMs": 90000
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"e41ec8af1dfd": {
"name": "agent.launchReplay#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"agent.launchReplay\",\"params\":{\"agent\":\"codex\",\"operationId\":\"1767225600000-00000000000040008000000000000004\",\"target\":{\"kind\":\"existing\",\"worktree\":\"id:wt-1\"},\"prompt\":{\"text\":\"review these notes\",\"delivery\":\"submit\"},\"launchSource\":\"diff_notes_send\",\"paneKey\":\"00000000-0000-4000-8000-000000000001:00000000-0000-4000-8000-000000000002\",\"sessionId\":\"codex_00000000_0000_4000_8000_000000000003\"}}"
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "session-create-terminal-diff-notes-launched",
"checkpoints": [
{
"id": "creating",
"observation": {
"sender": ["ad660413fab0"],
"payloads": ["e41ec8af1dfd"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "9270aeb7d9c6"
},
"state": "553cfc6cdea5",
"effects": []
}
},
{
"id": "notes-sent",
"observation": {
"sender": ["79b24f8555fe"],
"payloads": ["e41ec8af1dfd"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "eb79a9b3682a"
},
"state": "73449f52ee06",
"effects": ["6248a3dd0710", "0e3a24adf091"]
}
},
{
"id": "tabs-refreshed",
"observation": {
"sender": ["79b24f8555fe"],
"payloads": ["e41ec8af1dfd"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "eb79a9b3682a"
},
"state": "73449f52ee06",
"effects": ["6248a3dd0710", "0e3a24adf091"]
}
}
]
}
}
@@ -1,228 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.create-terminal",
"family": "session.create-terminal",
"namedDeltas": [],
"values": {
"553cfc6cdea5": {
"activeHandle": "terminal-0",
"activeSessionTabId": "tab-0",
"createError": "",
"creating": true,
"initializedHandles": ["terminal-0"],
"pendingSelection": {
"kind": "launched",
"lock": "mobile-create:mjuohs00-8ig2hens",
"snapshotsLeft": {
"$rpc": "null"
},
"surface": {
"handle": {
"$rpc": "null"
},
"pane": {
"leafId": "00000000-0000-4000-8000-000000000002",
"tabId": "00000000-0000-4000-8000-000000000001"
},
"sessionId": "codex_00000000_0000_4000_8000_000000000003"
}
},
"sessionTabs": [],
"terminals": []
},
"6248a3dd0710": {
"name": "fetch-session-tabs",
"ordinal": 3,
"value": {}
},
"73449f52ee06": {
"activeHandle": "terminal-0",
"activeSessionTabId": "tab-0",
"createError": "",
"creating": false,
"initializedHandles": ["terminal-0"],
"pendingSelection": {
"kind": "launched",
"lock": "mobile-create:mjuohs00-8ig2hens",
"snapshotsLeft": 5,
"surface": {
"handle": "terminal-1",
"pane": {
"leafId": "00000000-0000-4000-8000-000000000002",
"tabId": "00000000-0000-4000-8000-000000000001"
},
"sessionId": "codex_00000000_0000_4000_8000_000000000003"
}
},
"sessionTabs": [],
"terminals": []
},
"776182f604c7": {
"name": "toast",
"ordinal": 4,
"value": {
"durationMs": 2400,
"message": "The agent started, but the notes weren't sent."
}
},
"8f06d46b0825": {
"name": "agent.launchReplay#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "agent.launchReplay"
},
{
"name": "params",
"value": {
"agent": "codex",
"launchSource": "diff_notes_send",
"operationId": "1767225600000-00000000000040008000000000000004",
"paneKey": "00000000-0000-4000-8000-000000000001:00000000-0000-4000-8000-000000000002",
"prompt": {
"delivery": "submit",
"text": "review these notes"
},
"sessionId": "codex_00000000_0000_4000_8000_000000000003",
"target": {
"kind": "existing",
"worktree": "id:wt-1"
}
}
},
{
"name": "options",
"value": {
"timeoutMs": 90000
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"outcome": {
"handle": "terminal-1",
"kind": "terminal"
},
"prompt": {
"delivery": "submit",
"outcome": "not-delivered"
},
"receipt": {
"detail": "Started a terminal agent.",
"mode": "terminal",
"preferred": "terminal",
"reason": "user_default"
},
"worktreeId": "wt-1"
}
}
}
},
"9270aeb7d9c6": {
"status": "pending",
"startedAt": 0
},
"ad660413fab0": {
"name": "agent.launchReplay#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "agent.launchReplay"
},
{
"name": "params",
"value": {
"agent": "codex",
"launchSource": "diff_notes_send",
"operationId": "1767225600000-00000000000040008000000000000004",
"paneKey": "00000000-0000-4000-8000-000000000001:00000000-0000-4000-8000-000000000002",
"prompt": {
"delivery": "submit",
"text": "review these notes"
},
"sessionId": "codex_00000000_0000_4000_8000_000000000003",
"target": {
"kind": "existing",
"worktree": "id:wt-1"
}
}
},
{
"name": "options",
"value": {
"timeoutMs": 90000
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"e41ec8af1dfd": {
"name": "agent.launchReplay#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"agent.launchReplay\",\"params\":{\"agent\":\"codex\",\"operationId\":\"1767225600000-00000000000040008000000000000004\",\"target\":{\"kind\":\"existing\",\"worktree\":\"id:wt-1\"},\"prompt\":{\"text\":\"review these notes\",\"delivery\":\"submit\"},\"launchSource\":\"diff_notes_send\",\"paneKey\":\"00000000-0000-4000-8000-000000000001:00000000-0000-4000-8000-000000000002\",\"sessionId\":\"codex_00000000_0000_4000_8000_000000000003\"}}"
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "session-create-terminal-diff-notes-not-delivered",
"checkpoints": [
{
"id": "creating",
"observation": {
"sender": ["ad660413fab0"],
"payloads": ["e41ec8af1dfd"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "9270aeb7d9c6"
},
"state": "553cfc6cdea5",
"effects": []
}
},
{
"id": "notes-kept",
"observation": {
"sender": ["8f06d46b0825"],
"payloads": ["e41ec8af1dfd"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "eb79a9b3682a"
},
"state": "73449f52ee06",
"effects": ["6248a3dd0710", "776182f604c7"]
}
},
{
"id": "tabs-refreshed",
"observation": {
"sender": ["8f06d46b0825"],
"payloads": ["e41ec8af1dfd"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "eb79a9b3682a"
},
"state": "73449f52ee06",
"effects": ["6248a3dd0710", "776182f604c7"]
}
}
]
}
}
@@ -1,201 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.create-terminal",
"family": "session.create-terminal",
"namedDeltas": [],
"values": {
"27c32960f51e": {
"name": "session.tabs.createTerminal#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"session.tabs.createTerminal\",\"params\":{\"worktree\":\"id:wt-1\",\"afterTabId\":\"tab-0\",\"clientMutationId\":\"mobile-create:mjuohs00-8ig2hens\",\"agentPrompt\":\"summarize the diff\",\"agent\":\"claude\",\"activate\":false,\"select\":true,\"navigation\":\"caller\"}}"
},
"3166a9d93c25": {
"name": "session.tabs.createTerminal#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "session.tabs.createTerminal"
},
{
"name": "params",
"value": {
"activate": false,
"afterTabId": "tab-0",
"agent": "claude",
"agentPrompt": "summarize the diff",
"clientMutationId": "mobile-create:mjuohs00-8ig2hens",
"navigation": "caller",
"select": true,
"worktree": "id:wt-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"3225d4a6ece6": {
"name": "session.tabs.createTerminal#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "session.tabs.createTerminal"
},
{
"name": "params",
"value": {
"activate": false,
"afterTabId": "tab-0",
"agent": "claude",
"agentPrompt": "summarize the diff",
"clientMutationId": "mobile-create:mjuohs00-8ig2hens",
"navigation": "caller",
"select": true,
"worktree": "id:wt-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"tab": {
"id": "tab-1",
"isActive": true,
"terminal": "terminal-1",
"title": "zsh",
"type": "terminal"
}
}
}
}
},
"4d318de3b635": {
"name": "unsubscribe-terminal",
"ordinal": 3,
"value": {
"handle": "terminal-0"
}
},
"4e377b1c4bf7": {
"activeHandle": "terminal-1",
"activeSessionTabId": "tab-1",
"createError": "",
"creating": false,
"initializedHandles": [],
"pendingSelection": {
"handle": "terminal-1",
"kind": "terminal",
"tabId": "tab-1"
},
"sessionTabs": ["tab-1"],
"terminals": ["terminal-1"]
},
"6275ace50da2": {
"activeHandle": "terminal-0",
"activeSessionTabId": "tab-0",
"createError": "",
"creating": true,
"initializedHandles": ["terminal-0"],
"pendingSelection": {
"$rpc": "null"
},
"sessionTabs": [],
"terminals": []
},
"7a53e88025f0": {
"name": "fetch-session-tabs",
"ordinal": 6,
"value": {}
},
"9270aeb7d9c6": {
"status": "pending",
"startedAt": 0
},
"c9f8d8917777": {
"name": "subscribe-terminal",
"ordinal": 4,
"value": {
"handle": "terminal-1"
}
},
"e458e239d53c": {
"name": "schedule-delayed-action",
"ordinal": 5,
"value": {
"delayMs": 500
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "session-create-terminal-launches-an-agent-quick-command",
"checkpoints": [
{
"id": "creating",
"observation": {
"sender": ["3166a9d93c25"],
"payloads": ["27c32960f51e"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "9270aeb7d9c6"
},
"state": "6275ace50da2",
"effects": []
}
},
{
"id": "created",
"observation": {
"sender": ["3225d4a6ece6"],
"payloads": ["27c32960f51e"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "eb79a9b3682a"
},
"state": "4e377b1c4bf7",
"effects": ["4d318de3b635", "c9f8d8917777", "e458e239d53c"]
}
},
{
"id": "tabs-refreshed",
"observation": {
"sender": ["3225d4a6ece6"],
"payloads": ["27c32960f51e"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "eb79a9b3682a"
},
"state": "4e377b1c4bf7",
"effects": ["4d318de3b635", "c9f8d8917777", "e458e239d53c", "7a53e88025f0"]
}
}
]
}
}
@@ -1,197 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.create-terminal",
"family": "session.create-terminal",
"namedDeltas": [],
"values": {
"2977cbddd89f": {
"name": "session.tabs.createTerminal#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "session.tabs.createTerminal"
},
{
"name": "params",
"value": {
"activate": false,
"afterTabId": "tab-0",
"clientMutationId": "mobile-create:mjuohs00-8ig2hens",
"navigation": "caller",
"select": true,
"worktree": "id:wt-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"tab": {
"id": "tab-1",
"isActive": true,
"terminal": "terminal-1",
"title": "zsh",
"type": "terminal"
}
}
}
}
},
"4d318de3b635": {
"name": "unsubscribe-terminal",
"ordinal": 3,
"value": {
"handle": "terminal-0"
}
},
"4e377b1c4bf7": {
"activeHandle": "terminal-1",
"activeSessionTabId": "tab-1",
"createError": "",
"creating": false,
"initializedHandles": [],
"pendingSelection": {
"handle": "terminal-1",
"kind": "terminal",
"tabId": "tab-1"
},
"sessionTabs": ["tab-1"],
"terminals": ["terminal-1"]
},
"6275ace50da2": {
"activeHandle": "terminal-0",
"activeSessionTabId": "tab-0",
"createError": "",
"creating": true,
"initializedHandles": ["terminal-0"],
"pendingSelection": {
"$rpc": "null"
},
"sessionTabs": [],
"terminals": []
},
"7a53e88025f0": {
"name": "fetch-session-tabs",
"ordinal": 6,
"value": {}
},
"9270aeb7d9c6": {
"status": "pending",
"startedAt": 0
},
"b1d637072fc8": {
"name": "session.tabs.createTerminal#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "session.tabs.createTerminal"
},
{
"name": "params",
"value": {
"activate": false,
"afterTabId": "tab-0",
"clientMutationId": "mobile-create:mjuohs00-8ig2hens",
"navigation": "caller",
"select": true,
"worktree": "id:wt-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"c9f8d8917777": {
"name": "subscribe-terminal",
"ordinal": 4,
"value": {
"handle": "terminal-1"
}
},
"cce8a731064a": {
"name": "session.tabs.createTerminal#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"session.tabs.createTerminal\",\"params\":{\"worktree\":\"id:wt-1\",\"afterTabId\":\"tab-0\",\"clientMutationId\":\"mobile-create:mjuohs00-8ig2hens\",\"activate\":false,\"select\":true,\"navigation\":\"caller\"}}"
},
"e458e239d53c": {
"name": "schedule-delayed-action",
"ordinal": 5,
"value": {
"delayMs": 500
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "session-create-terminal-replaces-active",
"checkpoints": [
{
"id": "creating",
"observation": {
"sender": ["b1d637072fc8"],
"payloads": ["cce8a731064a"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "9270aeb7d9c6"
},
"state": "6275ace50da2",
"effects": []
}
},
{
"id": "created",
"observation": {
"sender": ["2977cbddd89f"],
"payloads": ["cce8a731064a"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "eb79a9b3682a"
},
"state": "4e377b1c4bf7",
"effects": ["4d318de3b635", "c9f8d8917777", "e458e239d53c"]
}
},
{
"id": "tabs-refreshed",
"observation": {
"sender": ["2977cbddd89f"],
"payloads": ["cce8a731064a"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "eb79a9b3682a"
},
"state": "4e377b1c4bf7",
"effects": ["4d318de3b635", "c9f8d8917777", "e458e239d53c", "7a53e88025f0"]
}
}
]
}
}
@@ -1,201 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.create-terminal",
"family": "session.create-terminal",
"namedDeltas": [],
"values": {
"4d318de3b635": {
"name": "unsubscribe-terminal",
"ordinal": 3,
"value": {
"handle": "terminal-0"
}
},
"4e377b1c4bf7": {
"activeHandle": "terminal-1",
"activeSessionTabId": "tab-1",
"createError": "",
"creating": false,
"initializedHandles": [],
"pendingSelection": {
"handle": "terminal-1",
"kind": "terminal",
"tabId": "tab-1"
},
"sessionTabs": ["tab-1"],
"terminals": ["terminal-1"]
},
"57f5d12210c7": {
"name": "session.tabs.createTerminal#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"session.tabs.createTerminal\",\"params\":{\"worktree\":\"id:wt-1\",\"afterTabId\":\"tab-0\",\"clientMutationId\":\"mobile-create:mjuohs00-8ig2hens\",\"command\":\"pnpm test\",\"startupCommandDelivery\":\"shell-ready\",\"activate\":false,\"select\":true,\"navigation\":\"caller\"}}"
},
"6275ace50da2": {
"activeHandle": "terminal-0",
"activeSessionTabId": "tab-0",
"createError": "",
"creating": true,
"initializedHandles": ["terminal-0"],
"pendingSelection": {
"$rpc": "null"
},
"sessionTabs": [],
"terminals": []
},
"7a53e88025f0": {
"name": "fetch-session-tabs",
"ordinal": 6,
"value": {}
},
"87e43dbf0e1e": {
"name": "session.tabs.createTerminal#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "session.tabs.createTerminal"
},
{
"name": "params",
"value": {
"activate": false,
"afterTabId": "tab-0",
"clientMutationId": "mobile-create:mjuohs00-8ig2hens",
"command": "pnpm test",
"navigation": "caller",
"select": true,
"startupCommandDelivery": "shell-ready",
"worktree": "id:wt-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"tab": {
"id": "tab-1",
"isActive": true,
"terminal": "terminal-1",
"title": "zsh",
"type": "terminal"
}
}
}
}
},
"9270aeb7d9c6": {
"status": "pending",
"startedAt": 0
},
"c9f8d8917777": {
"name": "subscribe-terminal",
"ordinal": 4,
"value": {
"handle": "terminal-1"
}
},
"dbd0992ab33b": {
"name": "session.tabs.createTerminal#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "session.tabs.createTerminal"
},
{
"name": "params",
"value": {
"activate": false,
"afterTabId": "tab-0",
"clientMutationId": "mobile-create:mjuohs00-8ig2hens",
"command": "pnpm test",
"navigation": "caller",
"select": true,
"startupCommandDelivery": "shell-ready",
"worktree": "id:wt-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"e458e239d53c": {
"name": "schedule-delayed-action",
"ordinal": 5,
"value": {
"delayMs": 500
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "session-create-terminal-runs-a-quick-command",
"checkpoints": [
{
"id": "creating",
"observation": {
"sender": ["dbd0992ab33b"],
"payloads": ["57f5d12210c7"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "9270aeb7d9c6"
},
"state": "6275ace50da2",
"effects": []
}
},
{
"id": "created",
"observation": {
"sender": ["87e43dbf0e1e"],
"payloads": ["57f5d12210c7"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "eb79a9b3682a"
},
"state": "4e377b1c4bf7",
"effects": ["4d318de3b635", "c9f8d8917777", "e458e239d53c"]
}
},
{
"id": "tabs-refreshed",
"observation": {
"sender": ["87e43dbf0e1e"],
"payloads": ["57f5d12210c7"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "eb79a9b3682a"
},
"state": "4e377b1c4bf7",
"effects": ["4d318de3b635", "c9f8d8917777", "e458e239d53c", "7a53e88025f0"]
}
}
]
}
}
@@ -1,203 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.create-terminal",
"family": "session.create-terminal",
"namedDeltas": [],
"values": {
"246e4444bf16": {
"name": "session.tabs.createTerminal#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"session.tabs.createTerminal\",\"params\":{\"worktree\":\"id:wt-1\",\"clientMutationId\":\"mobile-create:mjuohs00-8ig2hens\",\"activate\":false,\"select\":true,\"navigation\":\"caller\"}}"
},
"4d318de3b635": {
"name": "unsubscribe-terminal",
"ordinal": 3,
"value": {
"handle": "terminal-0"
}
},
"4e377b1c4bf7": {
"activeHandle": "terminal-1",
"activeSessionTabId": "tab-1",
"createError": "",
"creating": false,
"initializedHandles": [],
"pendingSelection": {
"handle": "terminal-1",
"kind": "terminal",
"tabId": "tab-1"
},
"sessionTabs": ["tab-1"],
"terminals": ["terminal-1"]
},
"5ab2dfc4122d": {
"name": "session.tabs.createTerminal#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "session.tabs.createTerminal"
},
{
"name": "params",
"value": {
"activate": false,
"afterTabId": {
"$rpc": "undefined"
},
"clientMutationId": "mobile-create:mjuohs00-8ig2hens",
"navigation": "caller",
"select": true,
"worktree": "id:wt-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "pending",
"startedAt": 0
}
},
"7a53e88025f0": {
"name": "fetch-session-tabs",
"ordinal": 6,
"value": {}
},
"9270aeb7d9c6": {
"status": "pending",
"startedAt": 0
},
"c9f8d8917777": {
"name": "subscribe-terminal",
"ordinal": 4,
"value": {
"handle": "terminal-1"
}
},
"d553e9003a7d": {
"name": "session.tabs.createTerminal#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "session.tabs.createTerminal"
},
{
"name": "params",
"value": {
"activate": false,
"afterTabId": {
"$rpc": "undefined"
},
"clientMutationId": "mobile-create:mjuohs00-8ig2hens",
"navigation": "caller",
"select": true,
"worktree": "id:wt-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"tab": {
"id": "tab-1",
"isActive": true,
"terminal": "terminal-1",
"title": "zsh",
"type": "terminal"
}
}
}
}
},
"dbfef1b09c9f": {
"activeHandle": "terminal-0",
"activeSessionTabId": {
"$rpc": "null"
},
"createError": "",
"creating": true,
"initializedHandles": ["terminal-0"],
"pendingSelection": {
"$rpc": "null"
},
"sessionTabs": [],
"terminals": []
},
"e458e239d53c": {
"name": "schedule-delayed-action",
"ordinal": 5,
"value": {
"delayMs": 500
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "session-create-terminal-without-active-tab",
"checkpoints": [
{
"id": "creating",
"observation": {
"sender": ["5ab2dfc4122d"],
"payloads": ["246e4444bf16"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "9270aeb7d9c6"
},
"state": "dbfef1b09c9f",
"effects": []
}
},
{
"id": "created",
"observation": {
"sender": ["d553e9003a7d"],
"payloads": ["246e4444bf16"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "eb79a9b3682a"
},
"state": "4e377b1c4bf7",
"effects": ["4d318de3b635", "c9f8d8917777", "e458e239d53c"]
}
},
{
"id": "tabs-refreshed",
"observation": {
"sender": ["d553e9003a7d"],
"payloads": ["246e4444bf16"],
"settlements": {
"mount": "eb79a9b3682a",
"create": "eb79a9b3682a"
},
"state": "4e377b1c4bf7",
"effects": ["4d318de3b635", "c9f8d8917777", "e458e239d53c", "7a53e88025f0"]
}
}
]
}
}
@@ -1,80 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.diff-notes",
"family": "session.diff-notes",
"namedDeltas": [],
"values": {
"270b4ca66aa7": {
"name": "worktree.show#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.show\",\"params\":{\"worktree\":\"id:workspace-1\"}}"
},
"432aeb4f1709": {
"busy": false,
"diffComments": [],
"pendingDelivery": {
"$rpc": "null"
}
},
"52ec1b835753": {
"name": "worktree.show#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "worktree.show"
},
{
"name": "params",
"value": {
"worktree": "id:workspace-1"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"error": {
"code": "worktree_not_found",
"message": "No such workspace"
},
"id": "frame-1",
"ok": false
}
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "session-diff-notes-load-refused",
"checkpoints": [
{
"id": "unchanged",
"observation": {
"sender": ["52ec1b835753"],
"payloads": ["270b4ca66aa7"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "432aeb4f1709",
"effects": []
}
}
]
}
}
@@ -1,122 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.diff-notes",
"family": "session.diff-notes",
"namedDeltas": [],
"values": {
"194b8cd56a74": {
"name": "worktree.show#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "worktree.show"
},
{
"name": "params",
"value": {
"worktree": "id:workspace-1"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"worktree": {
"diffComments": [
{
"body": "needs a test",
"createdAt": 0,
"filePath": "src/app.ts",
"id": "note-1",
"lineNumber": 4,
"worktreeId": "workspace-1"
}
]
}
}
}
}
},
"270b4ca66aa7": {
"name": "worktree.show#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"worktree.show\",\"params\":{\"worktree\":\"id:workspace-1\"}}"
},
"e28b1ad79121": {
"busy": false,
"diffComments": [
{
"body": "needs a test",
"createdAt": 0,
"diffIdentity": {
"$rpc": "undefined"
},
"filePath": "src/app.ts",
"id": "note-1",
"lineNumber": 4,
"oldPath": {
"$rpc": "undefined"
},
"scope": {
"$rpc": "undefined"
},
"selectedText": {
"$rpc": "undefined"
},
"sentAt": {
"$rpc": "undefined"
},
"side": "modified",
"source": "diff",
"startLine": {
"$rpc": "undefined"
},
"updatedAt": {
"$rpc": "undefined"
},
"worktreeId": "workspace-1"
}
],
"pendingDelivery": {
"$rpc": "null"
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "session-diff-notes-loaded",
"checkpoints": [
{
"id": "loaded",
"observation": {
"sender": ["194b8cd56a74"],
"payloads": ["270b4ca66aa7"],
"settlements": {
"mount": "eb79a9b3682a"
},
"state": "e28b1ad79121",
"effects": []
}
}
]
}
}
@@ -1,87 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.tab-documents",
"family": "session.tab-documents",
"namedDeltas": [],
"values": {
"023c5158861a": {
"name": "files.read#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "files.read"
},
{
"name": "params",
"value": {
"relativePath": "src/app.ts",
"worktree": "id:workspace-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"byteLength": 2,
"content": "a\n",
"truncated": false
}
}
}
},
"5ea03f95e781": {
"file": {
"tab-file": {
"byteLength": 2,
"content": "a\n",
"kind": "file",
"status": "ready",
"truncated": false
}
},
"markdown": {}
},
"c59b180ead68": {
"name": "files.read#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"files.read\",\"params\":{\"worktree\":\"id:workspace-1\",\"relativePath\":\"src/app.ts\"}}"
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "session-file-tab-read",
"checkpoints": [
{
"id": "read",
"observation": {
"sender": ["023c5158861a"],
"payloads": ["c59b180ead68"],
"settlements": {
"file": "eb79a9b3682a"
},
"state": "5ea03f95e781",
"effects": []
}
}
]
}
}
@@ -1,131 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.tab-documents",
"family": "session.markdown-disk-fallback",
"namedDeltas": [],
"values": {
"44abbe2af7aa": {
"name": "markdown.readTab#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"markdown.readTab\",\"params\":{\"worktree\":\"id:workspace-1\",\"tabId\":\"tab-md\"}}"
},
"c6cea5310098": {
"file": {},
"markdown": {
"tab-md": {
"baseVersion": "",
"content": "# disk",
"editable": false,
"isDirty": false,
"localContent": "# disk",
"readOnlyReason": "Editing needs Orca desktop running.",
"stale": false,
"status": "ready"
}
}
},
"d4be01606497": {
"name": "files.read#1",
"ordinal": 4,
"json": "{\"id\":\"frame-2\",\"deviceToken\":\"recording-device\",\"method\":\"files.read\",\"params\":{\"worktree\":\"id:workspace-1\",\"relativePath\":\"docs/readme.md\"}}"
},
"d59404d25d6c": {
"name": "files.read#1",
"ordinal": 3,
"args": [
{
"name": "method",
"value": "files.read"
},
{
"name": "params",
"value": {
"relativePath": "docs/readme.md",
"worktree": "id:workspace-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-2",
"ok": true,
"result": {
"byteLength": 6,
"content": "# disk",
"truncated": false
}
}
}
},
"e258dafc91f1": {
"name": "markdown.readTab#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "markdown.readTab"
},
{
"name": "params",
"value": {
"tabId": "tab-md",
"worktree": "id:workspace-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"error": {
"code": "renderer_unavailable",
"message": "Renderer unavailable"
},
"id": "frame-1",
"ok": false
}
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "session-markdown-disk-read",
"checkpoints": [
{
"id": "fell-back",
"observation": {
"sender": ["e258dafc91f1", "d59404d25d6c"],
"payloads": ["44abbe2af7aa", "d4be01606497"],
"settlements": {
"markdown": "eb79a9b3682a"
},
"state": "c6cea5310098",
"effects": []
}
}
]
}
}
@@ -1,93 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.tab-documents",
"family": "session.markdown-disk-fallback",
"namedDeltas": [],
"values": {
"0d6b0adc036f": {
"name": "markdown.readTab#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "markdown.readTab"
},
{
"name": "params",
"value": {
"tabId": "tab-md",
"worktree": "id:workspace-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"content": "# served",
"editable": true,
"isDirty": false,
"version": "v1"
}
}
}
},
"3e3efaab3a20": {
"file": {},
"markdown": {
"tab-md": {
"baseVersion": "v1",
"content": "# served",
"editable": true,
"isDirty": false,
"localContent": "# served",
"readOnlyReason": {
"$rpc": "undefined"
},
"stale": false,
"status": "ready"
}
}
},
"44abbe2af7aa": {
"name": "markdown.readTab#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"markdown.readTab\",\"params\":{\"worktree\":\"id:workspace-1\",\"tabId\":\"tab-md\"}}"
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "session-markdown-disk-served",
"checkpoints": [
{
"id": "served",
"observation": {
"sender": ["0d6b0adc036f"],
"payloads": ["44abbe2af7aa"],
"settlements": {
"markdown": "eb79a9b3682a"
},
"state": "3e3efaab3a20",
"effects": []
}
}
]
}
}
@@ -1,93 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.tab-documents",
"family": "session.tab-documents",
"namedDeltas": [],
"values": {
"44abbe2af7aa": {
"name": "markdown.readTab#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"markdown.readTab\",\"params\":{\"worktree\":\"id:workspace-1\",\"tabId\":\"tab-md\"}}"
},
"79f4c7ca7e69": {
"name": "markdown.readTab#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "markdown.readTab"
},
{
"name": "params",
"value": {
"tabId": "tab-md",
"worktree": "id:workspace-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"content": "# a",
"editable": true,
"isDirty": false,
"version": "v1"
}
}
}
},
"d4cf305b17f8": {
"file": {},
"markdown": {
"tab-md": {
"baseVersion": "v1",
"content": "# a",
"editable": true,
"isDirty": false,
"localContent": "# a",
"readOnlyReason": {
"$rpc": "undefined"
},
"stale": false,
"status": "ready"
}
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "session-markdown-tab-read",
"checkpoints": [
{
"id": "read",
"observation": {
"sender": ["79f4c7ca7e69"],
"payloads": ["44abbe2af7aa"],
"settlements": {
"markdown": "eb79a9b3682a"
},
"state": "d4cf305b17f8",
"effects": []
}
}
]
}
}
@@ -1,83 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.tab-documents",
"family": "session.tab-documents",
"namedDeltas": [],
"values": {
"31e723411add": {
"name": "markdown.readTab#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "markdown.readTab"
},
{
"name": "params",
"value": {
"tabId": "tab-md",
"worktree": "id:workspace-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"error": {
"code": "tab_not_found",
"message": "No such tab"
},
"id": "frame-1",
"ok": false
}
}
},
"44abbe2af7aa": {
"name": "markdown.readTab#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"markdown.readTab\",\"params\":{\"worktree\":\"id:workspace-1\",\"tabId\":\"tab-md\"}}"
},
"877720375363": {
"file": {},
"markdown": {
"tab-md": {
"message": "Couldn't load markdown",
"status": "error"
}
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "session-markdown-tab-refused",
"checkpoints": [
{
"id": "errored",
"observation": {
"sender": ["31e723411add"],
"payloads": ["44abbe2af7aa"],
"settlements": {
"markdown": "eb79a9b3682a"
},
"state": "877720375363",
"effects": []
}
}
]
}
}
@@ -1,94 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.tab-close",
"family": "session.tab-close-session",
"namedDeltas": [],
"values": {
"1195cdf08e57": {
"name": "unsubscribe-terminal",
"ordinal": 3,
"value": {
"handle": "terminal-1"
}
},
"50a46af5cf5c": {
"name": "session.tabs.close#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"session.tabs.close\",\"params\":{\"worktree\":\"id:workspace-1\",\"tabId\":\"tab-1\",\"reason\":\"user\"}}"
},
"567d11711027": {
"activeHandle": {
"$rpc": "null"
},
"sessionTabs": [],
"terminals": [
{
"handle": "terminal-1",
"isActive": true,
"title": "Terminal"
}
]
},
"de4cc94c0333": {
"name": "session.tabs.close#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "session.tabs.close"
},
{
"name": "params",
"value": {
"reason": "user",
"tabId": "tab-1",
"worktree": "id:workspace-1"
}
},
{
"name": "options",
"value": {
"$rpc": "absent"
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"closed": true
}
}
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "session-tab-closed",
"checkpoints": [
{
"id": "closed",
"observation": {
"sender": ["de4cc94c0333"],
"payloads": ["50a46af5cf5c"],
"settlements": {
"close-tab": "eb79a9b3682a"
},
"state": "567d11711027",
"effects": ["1195cdf08e57"]
}
}
]
}
}
@@ -1,97 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.tab-close",
"family": "session.tab-close",
"namedDeltas": [],
"values": {
"0923ddf47a9b": {
"name": "fetch-terminals",
"ordinal": 3,
"value": {}
},
"42b6d6d7fdf9": {
"activeHandle": "terminal-1",
"sessionTabs": [
{
"id": "tab-1",
"isActive": true,
"terminal": "terminal-1",
"title": "Terminal",
"type": "terminal"
}
],
"terminals": [
{
"handle": "terminal-1",
"isActive": true,
"title": "build"
}
]
},
"7e43ade02444": {
"name": "terminal.rename#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"terminal.rename\",\"params\":{\"terminal\":\"terminal-1\",\"title\":\"build\"}}"
},
"b6460631c63c": {
"name": "terminal.rename#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "terminal.rename"
},
{
"name": "params",
"value": {
"terminal": "terminal-1",
"title": "build"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"renamed": true
}
}
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "session-tab-rename",
"checkpoints": [
{
"id": "renamed",
"observation": {
"sender": ["b6460631c63c"],
"payloads": ["7e43ade02444"],
"settlements": {
"rename": "eb79a9b3682a"
},
"state": "42b6d6d7fdf9",
"effects": ["0923ddf47a9b"]
}
}
]
}
}
@@ -1,97 +0,0 @@
{
"goldenFormatVersion": 6,
"operation": "session.tab-close",
"family": "session.tab-rename",
"namedDeltas": [],
"values": {
"0923ddf47a9b": {
"name": "fetch-terminals",
"ordinal": 3,
"value": {}
},
"42b6d6d7fdf9": {
"activeHandle": "terminal-1",
"sessionTabs": [
{
"id": "tab-1",
"isActive": true,
"terminal": "terminal-1",
"title": "Terminal",
"type": "terminal"
}
],
"terminals": [
{
"handle": "terminal-1",
"isActive": true,
"title": "build"
}
]
},
"7e43ade02444": {
"name": "terminal.rename#1",
"ordinal": 2,
"json": "{\"id\":\"frame-1\",\"deviceToken\":\"recording-device\",\"method\":\"terminal.rename\",\"params\":{\"terminal\":\"terminal-1\",\"title\":\"build\"}}"
},
"b6460631c63c": {
"name": "terminal.rename#1",
"ordinal": 1,
"args": [
{
"name": "method",
"value": "terminal.rename"
},
{
"name": "params",
"value": {
"terminal": "terminal-1",
"title": "build"
}
},
{
"name": "options",
"value": {
"failWhenDisconnected": true
}
}
],
"settlement": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"id": "frame-1",
"ok": true,
"result": {
"renamed": true
}
}
}
},
"eb79a9b3682a": {
"status": "fulfilled",
"startedAt": 0,
"settledAt": 0,
"value": {
"$rpc": "undefined"
}
}
},
"recording": {
"scenario": "session-tab-renamed",
"checkpoints": [
{
"id": "renamed",
"observation": {
"sender": ["b6460631c63c"],
"payloads": ["7e43ade02444"],
"settlements": {
"rename": "eb79a9b3682a"
},
"state": "42b6d6d7fdf9",
"effects": ["0923ddf47a9b"]
}
}
]
}
}
File diff suppressed because it is too large Load Diff
@@ -1,11 +1,8 @@
import { describe, expect, it } from 'vitest'
import {
browserWheelDeltaFromScreen,
clampBrowserZoomState,
computeBrowserFrameGeometry,
computeBrowserTouchClickRadiusCss,
mapScreenToBrowserPoint,
readLocalTouchPoint
mapScreenToBrowserPoint
} from './browser-touch-geometry'
const NO_ZOOM = { scale: 1, offsetX: 0, offsetY: 0 }
@@ -21,28 +18,6 @@ const NO_VIEWPORT_META = {
}
describe('browser touch geometry', () => {
it('maps the visual center of a letterboxed desktop frame to the browser center', () => {
const layout = { width: 390, height: 700 }
const metadata = { deviceWidth: 1280, deviceHeight: 720 }
const geometry = computeBrowserFrameGeometry(layout, metadata)
expect(geometry).toMatchObject({
renderedWidth: 390,
offsetX: 0,
sourceWidth: 1280,
sourceHeight: 720
})
expect(
mapScreenToBrowserPoint(
195,
geometry!.offsetY + geometry!.renderedHeight / 2,
layout,
metadata,
{ scale: 1, offsetX: 0, offsetY: 0 }
)
).toEqual({ x: 640, y: 360 })
})
it('divides the frame device space by the page scale and adds no scroll offset', () => {
const layout = { width: 400, height: 600 }
const metadata = {
@@ -56,31 +31,6 @@ describe('browser touch geometry', () => {
expect(mapScreenToBrowserPoint(100, 200, layout, metadata, NO_ZOOM)).toEqual({ x: 200, y: 400 })
})
it('reads a missing or unusable page scale as one rather than dividing by it', () => {
const layout = { width: 402, height: 593 }
for (const pageScaleFactor of [undefined, 0, -1, Number.NaN]) {
expect(
mapScreenToBrowserPoint(
120,
240,
layout,
{ deviceWidth: 402, deviceHeight: 593, pageScaleFactor },
NO_ZOOM
)
).toEqual({ x: 120, y: 240 })
}
})
it('grows the touch radius by the page scale, because a CSS pixel is smaller', () => {
const layout = { width: 400, height: 600 }
const metadata = { deviceWidth: 400, deviceHeight: 600, pageScaleFactor: 0.5 }
expect(computeBrowserTouchClickRadiusCss(layout, metadata, NO_ZOOM, 14)).toBe(28)
expect(
computeBrowserTouchClickRadiusCss(layout, { ...metadata, pageScaleFactor: 1 }, NO_ZOOM, 14)
).toBe(14)
})
it('scrolls the page by the page scale, not by the frame fit alone', () => {
const layout = { width: 402, height: 593 }
const geometry = computeBrowserFrameGeometry(layout, NO_VIEWPORT_META)
@@ -93,40 +43,4 @@ describe('browser touch geometry', () => {
// What it sent before: the screen delta itself, 41% of the scroll asked for.
expect(delta.dy).not.toBe(-100)
})
it('leaves a web view scroll and a pinched one where they were', () => {
const layout = { width: 402, height: 593 }
const unscaled = computeBrowserFrameGeometry(layout, {
deviceWidth: 402,
deviceHeight: 593,
pageScaleFactor: 1
})
expect(browserWheelDeltaFromScreen(0, 100, unscaled, 1)).toEqual({ dx: 0, dy: -100 })
// A pinch to 2x halves what a screen point is worth, on top of whatever the page scale is.
expect(browserWheelDeltaFromScreen(0, 100, unscaled, 2)).toEqual({ dx: 0, dy: -50 })
expect(browserWheelDeltaFromScreen(-40, 0, null, 1)).toEqual({ dx: 40, dy: 0 })
})
it('rejects page-level touch coordinates instead of mixing coordinate spaces', () => {
expect(readLocalTouchPoint({ pageX: 120, pageY: 240 })).toBeNull()
})
it('clamps zoom offsets after the viewport geometry changes', () => {
const nextGeometry = computeBrowserFrameGeometry(
{ width: 390, height: 700 },
{ deviceWidth: 1280, deviceHeight: 720 }
)!
const clamped = clampBrowserZoomState(
{ scale: 3.5, offsetX: 300, offsetY: 500 },
nextGeometry,
1,
3.5
)
expect(clamped.scale).toBe(3.5)
expect(clamped.offsetX).toBe(300)
expect(clamped.offsetY).toBeCloseTo(33.90625)
})
})
@@ -1,22 +0,0 @@
import { describe, expect, it } from 'vitest'
import { choiceLabel, summarizeChecklist } from './workspace-option-values'
describe('a checklist option value on the main sheet', () => {
it('reads all, none, the single checked item, or a count', () => {
expect(summarizeChecklist(['a', 'b', 'c'], 3, 'All hosts')).toBe('All hosts')
expect(summarizeChecklist([], 3, 'All')).toBe('None')
expect(summarizeChecklist(['m4 air'], 3, 'All hosts')).toBe('m4 air')
expect(summarizeChecklist(['a', 'b'], 3, 'All')).toBe('2 of 3')
})
})
describe('a pick-one option value', () => {
it("reads the chosen choice's label, and nothing for an unknown id", () => {
const choices = [
{ id: 'name', label: 'Name' },
{ id: 'recent', label: 'Recent' }
]
expect(choiceLabel(choices, 'recent')).toBe('Recent')
expect(choiceLabel(choices, 'newer-host-value')).toBe('')
})
})
@@ -1,63 +0,0 @@
import { beforeEach, describe, expect, it } from 'vitest'
import {
consumeMockCodexResetCredit,
createMockAccountsSnapshot,
getMockCodexResetScope,
resetMockAccountState,
selectMockCodexAccount
} from '../scripts/mock-server-account-state'
const FIRST_OPERATION_ID = '11111111-1111-4111-8111-111111111111'
describe('mock account reset state', () => {
beforeEach(() => {
resetMockAccountState(1_700_000_000_000)
})
it('keeps reset and expiry deadlines fixed between snapshots', () => {
const first = createMockAccountsSnapshot()
expect(first.rateLimits.codex.session?.resetsAt).toBe(1_700_005_400_000)
expect(first.rateLimits.codex.rateLimitResetCredits.nextExpiresAt).toBe(1_700_432_000_000)
const second = createMockAccountsSnapshot()
expect(second.rateLimits.codex.session?.resetsAt).toBe(first.rateLimits.codex.session?.resetsAt)
expect(second.rateLimits.codex.rateLimitResetCredits.nextExpiresAt).toBe(
first.rateLimits.codex.rateLimitResetCredits.nextExpiresAt
)
})
it('resets only the selected account and updates its visible usage', () => {
const personalScope = getMockCodexResetScope()
expect(personalScope).not.toBeNull()
expect(consumeMockCodexResetCredit(FIRST_OPERATION_ID, personalScope)).toMatchObject({
outcome: 'reset',
scope: personalScope
})
const personalAfter = createMockAccountsSnapshot()
expect(personalAfter.rateLimits.codex.session?.usedPercent).toBe(0)
expect(personalAfter.rateLimits.codex.rateLimitResetCredits.availableCount).toBe(0)
selectMockCodexAccount('codex-team')
const team = createMockAccountsSnapshot()
expect(team.rateLimits.codex.session?.usedPercent).toBe(100)
expect(team.rateLimits.codex.rateLimitResetCredits.availableCount).toBe(1)
expect(getMockCodexResetScope()?.accountId).toBe('codex-team')
})
it('replays the same operation result and authoritatively discards a stale attempt', () => {
const scope = getMockCodexResetScope()
expect(scope).not.toBeNull()
const first = consumeMockCodexResetCredit(FIRST_OPERATION_ID, scope)
expect(first).toEqual({ outcome: 'reset', scope })
expect(consumeMockCodexResetCredit(FIRST_OPERATION_ID, scope)).toEqual(first)
expect(() => consumeMockCodexResetCredit('not-a-uuid', scope)).toThrow('Invalid idempotencyKey')
expect(consumeMockCodexResetCredit('22222222-2222-4222-8222-222222222222', scope)).toEqual({
status: 'rejectedBeforeProvider',
retryDisposition: 'discardAttempt',
reason: 'offerChanged',
scope
})
})
})
@@ -1,92 +0,0 @@
import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest'
import type { WebSocket } from 'ws'
import type {
handleRequest as handleRpcRequest,
RpcRequest,
RpcResponse
} from '../scripts/mock-server-rpc-handlers'
let handleRequest: typeof handleRpcRequest
beforeAll(async () => {
vi.stubEnv('MOCK_NATIVE_CHAT', '0')
vi.stubEnv('MOCK_REPO_COUNT', '2')
vi.stubEnv('MOCK_WORKTREE_COUNT', '2')
vi.stubEnv('MOCK_RPC_DELAY_MS', '0')
for (const method of ['session.tabs.list', 'terminal.list']) {
vi.stubEnv(`MOCK_RPC_DELAY_${method.replaceAll('.', '_').toUpperCase()}_MS`, '0')
}
;({ handleRequest } = await import('../scripts/mock-server-rpc-handlers'))
})
afterAll(() => vi.unstubAllEnvs())
function callRpc(method: string, params?: Record<string, unknown>): RpcResponse {
let response: RpcResponse | undefined
const request: RpcRequest = { id: 'request-1', method, ...(params ? { params } : {}) }
handleRequest(
request,
(nextResponse) => {
response = nextResponse
},
{} as WebSocket
)
expect(response).toBeDefined()
return response!
}
function listSessionTabs(worktree: string): RpcResponse {
return callRpc('session.tabs.list', { worktree })
}
describe('mock server session tabs fixture', () => {
it('returns a contract-complete terminal surface for the requested worktree', () => {
const response = listSessionTabs('id:repo-1::worktree-1')
expect(response.result).toEqual({
worktree: 'repo-1::worktree-1',
publicationEpoch: expect.stringMatching(/^mock-server:/),
snapshotVersion: 1,
activeGroupId: 'group-1',
activeTabId: 'tab-1::f47ac10b-58cc-4372-a567-0e02b2c3d479',
activeTabType: 'terminal',
tabGroups: [
{
id: 'group-1',
activeTabId: 'tab-1',
tabOrder: ['tab-1'],
recentTabIds: ['tab-1']
}
],
tabs: [
{
type: 'terminal',
id: 'tab-1::f47ac10b-58cc-4372-a567-0e02b2c3d479',
title: 'zsh',
parentTabId: 'tab-1',
leafId: 'f47ac10b-58cc-4372-a567-0e02b2c3d479',
status: 'ready',
terminal: 'term-1',
isActive: true
}
]
})
})
it('passes a bare worktree selector through unprefixed', () => {
const response = listSessionTabs('repo-1::worktree-1')
expect((response.result as { worktree: string }).worktree).toBe('repo-1::worktree-1')
})
it('falls back to the same worktree terminal.list uses when no selector is sent', () => {
const terminals = callRpc('terminal.list').result as {
terminals: { worktreeId: string }[]
}
const expected = terminals.terminals[0]?.worktreeId
expect(expected).toBeTruthy()
const tabs = callRpc('session.tabs.list').result as { worktree: string }
expect(tabs.worktree).toBe(expected)
})
})
@@ -1,65 +0,0 @@
import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest'
import type { WebSocket } from 'ws'
import type {
handleRequest as handleRpcRequest,
RpcRequest,
RpcResponse
} from '../scripts/mock-server-rpc-handlers'
let handleRequest: typeof handleRpcRequest
beforeAll(async () => {
vi.stubEnv('MOCK_NATIVE_CHAT', '0')
vi.stubEnv('MOCK_REPO_COUNT', '2')
vi.stubEnv('MOCK_WORKTREE_COUNT', '2')
vi.stubEnv('MOCK_RPC_DELAY_MS', '0')
for (const method of ['worktree.ps', 'worktree.create', 'worktree.activate', 'terminal.list']) {
vi.stubEnv(`MOCK_RPC_DELAY_${method.replaceAll('.', '_').toUpperCase()}_MS`, '0')
}
;({ handleRequest } = await import('../scripts/mock-server-rpc-handlers'))
})
afterAll(() => vi.unstubAllEnvs())
let requestSequence = 0
function sendMockRequest(method: string, params?: Record<string, unknown>): RpcResponse {
let response: RpcResponse | undefined
const request: RpcRequest = { id: `request-${++requestSequence}`, method, params }
handleRequest(
request,
(nextResponse) => {
response = nextResponse
},
{} as WebSocket
)
expect(response).toBeDefined()
return response!
}
function listedTerminalWorktreeIds(worktree?: string): string[] {
const response = sendMockRequest('terminal.list', worktree ? { worktree } : undefined)
const result = response.result as { terminals: Array<{ worktreeId: string }> }
return [...new Set(result.terminals.map((terminal) => terminal.worktreeId))]
}
describe('mock server terminal fixture routing', () => {
it('follows worktree creation and activation', () => {
const worktreeResponse = sendMockRequest('worktree.ps')
const initialWorktreeId = (
worktreeResponse.result as { worktrees: Array<{ worktreeId: string }> }
).worktrees[0]!.worktreeId
const createResponse = sendMockRequest('worktree.create', {
repo: 'id:repo-1',
name: 'terminal-fixture-routing'
})
const createdWorktreeId = (createResponse.result as { worktree: { id: string } }).worktree.id
expect(createdWorktreeId).not.toBe(initialWorktreeId)
expect(listedTerminalWorktreeIds()).toEqual([createdWorktreeId])
expect(listedTerminalWorktreeIds(`id:${initialWorktreeId}`)).toEqual([initialWorktreeId])
sendMockRequest('worktree.activate', { worktree: `id:${initialWorktreeId}` })
expect(listedTerminalWorktreeIds()).toEqual([initialWorktreeId])
})
})
@@ -1,10 +1,7 @@
import type * as UseMobileSessionDiffCommentsModule from '../../../source-control/review/use-mobile-session-diff-comments'
import type * as UseMobileSessionMarkdownActionsModule from '../../../files/session-documents/use-mobile-session-markdown-actions'
import type * as UseQuickCommandsModule from '../../../terminal/quick-commands/use-quick-commands'
import { hookMount, performHookAction } from '../hook-mount'
import { mountFixture } from '../recorder-fixture-shape'
import type { DiffComment } from '../../../../../src/shared/diff-comment-types'
import type { DiffNotesDelivery } from '../../../source-control/review/mobile-review-comment-state'
import type { MarkdownDocState } from '../../../files/session-documents/session-document-state'
import type { MountAdapter } from '../recording-scenario'
import type { operationModuleLoader } from '../operation-module-loader'
@@ -17,67 +14,6 @@ export function sessionNotesMountAdapters(
modules: ReturnType<typeof operationModuleLoader>
): Record<string, MountAdapter> {
return {
'session.diff-notes': ({ client, effect }) => {
const useComments = modules.load<typeof UseMobileSessionDiffCommentsModule>(
'mobile/src/source-control/review/use-mobile-session-diff-comments.ts'
).useMobileSessionDiffComments
let diffComments: DiffComment[] = []
const diffCommentsRef = { current: diffComments }
let busy = false
let pendingDelivery: DiffNotesDelivery | null = null
let comments: ReturnType<typeof useComments>
const hook = hookMount(() => {
comments = useComments(
mountFixture<Parameters<typeof useComments>[0]>({
worktreeId: WORKSPACE,
isFloatingWorkspaceRoute: false,
client,
connState: 'connected',
setDiffComments: (update) => {
diffComments = typeof update === 'function' ? update(diffComments) : update
diffCommentsRef.current = diffComments
},
diffCommentsRef,
diffCommentBusy: busy,
setDiffCommentBusy: (update) => {
busy = typeof update === 'function' ? update(busy) : update
},
setPendingDiffNotesDelivery: (update) => {
pendingDelivery = typeof update === 'function' ? update(pendingDelivery) : update
},
showToast: (message: string) => effect('toast', { message })
})
)
})
return {
action(name, args) {
if (name === 'mount') {
return hook.mount()
}
return performHookAction(() => {
if (name === 'add') {
return comments.addDiffCommentForFile(
'src/app.ts',
Number(args.line ?? 4),
String(args.body ?? 'needs a test')
)
}
if (name === 'delete') {
return comments.deleteDiffCommentForFile(String(args.id ?? 'note-1'))
}
if (name === 'copy') {
return comments.copyDiffCommentsToClipboard()
}
if (name === 'reload') {
return comments.loadDiffComments()
}
throw new Error(`Unknown diff notes action: ${name}`)
})
},
state: () => ({ diffComments, busy, pendingDelivery }),
dispose: hook.unmount
}
},
'session.markdown-save': ({ client, effect }) => {
const useMarkdown = modules.load<typeof UseMobileSessionMarkdownActionsModule>(
'mobile/src/files/session-documents/use-mobile-session-markdown-actions.ts'
@@ -10,7 +10,6 @@ import type { TerminalRecord } from '../../../terminal/session/mobile-terminal-r
import { mountFixture } from '../recorder-fixture-shape'
import type { MountAdapter } from '../recording-scenario'
import type { operationModuleLoader } from '../operation-module-loader'
import type * as MobileNativeChatReadability from '../../../session/native-chat/transcript/use-mobile-native-chat-readability'
import type * as MobileNativeChatStopModule from '../../../session/native-chat/composer/use-mobile-native-chat-stop'
const WORKSPACE = 'workspace-1'
@@ -50,7 +49,7 @@ export function sessionScreenReadMountAdapters(
})
hook.mount()
return {
action(name, args) {
action(name) {
if (name === 'markdown') {
return performHookAction(() =>
readers.readMarkdownTab(
@@ -58,19 +57,7 @@ export function sessionScreenReadMountAdapters(
type: 'markdown',
id: 'tab-md',
relativePath: 'docs/readme.md',
isDirty: args.dirty === true
})
)
)
}
if (name === 'file') {
return performHookAction(() =>
readers.readFileTab(
mountFixture<Parameters<typeof readers.readFileTab>[0]>({
type: 'file',
id: 'tab-file',
relativePath: 'src/app.ts',
...(args.diff === true ? { diffSource: 'staged' as const } : {})
isDirty: false
})
)
)
@@ -137,30 +124,6 @@ export function sessionScreenReadMountAdapters(
dispose: hook.unmount
}
},
'session.native-chat-readability': ({ client }) => {
const useReadability = modules.load<typeof MobileNativeChatReadability>(
'mobile/src/session/native-chat/transcript/use-mobile-native-chat-readability.ts'
).useMobileNativeChatReadability
let readable = false
let worktreeId = `repo-1::/w`
const hook = hookMount(() => {
readable = useReadability(client, worktreeId)
})
return {
action(name) {
if (name === 'mount') {
return hook.mount()
}
if (name === 'reroute') {
worktreeId = 'repo-2::/w'
return hook.update()
}
throw new Error(`Unknown readability action: ${name}`)
},
state: () => ({ readable, worktreeId }),
dispose: hook.unmount
}
},
'session.native-chat-stop': ({ client, effect }) => {
const useStop = modules.load<typeof MobileNativeChatStopModule>(
'mobile/src/session/native-chat/composer/use-mobile-native-chat-stop.ts'
@@ -10,7 +10,7 @@ import type { operationModuleLoader } from '../operation-module-loader'
const WORKSPACE = 'workspace-1'
const HANDLE = 'terminal-1'
// Project the real tab list so refused rename/close writes cannot masquerade as successful local erasure.
// Project the real tab list so refused closes cannot masquerade as successful local erasure.
export function sessionScreenTabMountAdapters(
modules: ReturnType<typeof operationModuleLoader>
): Record<string, MountAdapter> {
@@ -104,8 +104,6 @@ export function sessionScreenTabMountAdapters(
let sessionTabs: MobileSessionTab[] = sessionTabsRef.current
let activeHandle: string | null = HANDLE
const activeHandleRef: { current: string | null } = { current: HANDLE }
const renameTarget: { handle: string } | null = { handle: HANDLE }
const timers: ReturnType<typeof setTimeout>[] = []
let actions: ReturnType<typeof useClose>
const hook = hookMount(() => {
actions = useClose(
@@ -129,37 +127,23 @@ export function sessionScreenTabMountAdapters(
setActiveSessionTabId: () => {},
activeSessionTabIdRef: { current: 'tab-1' },
selectedSessionTabIdRef: { current: 'tab-1' },
renameTarget,
setRenameTarget: () => {},
terminalRefs: { current: new Map() },
initializedHandlesRef: { current: new Set([HANDLE]) },
activeHandleRef,
activeSessionTabTypeRef: { current: 'terminal' },
pendingSelectionRef: { current: null },
pendingBrowserFocusPageIdRef: { current: null },
scheduleDelayedAction: (callback: () => void, delayMs: number) => {
timers.push(setTimeout(callback, delayMs))
},
unsubscribeTerminal: (handle: string) => effect('unsubscribe-terminal', { handle }),
subscribeToTerminal: (handle: string) => {
effect('subscribe-terminal', { handle })
return true
},
fetchTerminals: () => {
effect('fetch-terminals', {})
return Promise.resolve(true)
}
})
)
})
hook.mount()
return {
action(name, args) {
if (name === 'rename') {
return performHookAction(() =>
actions.handleRenameTerminal(String(args.title ?? 'renamed'))
)
}
action(name) {
if (name === 'close-terminal') {
return performHookAction(() =>
actions.handleCloseTerminal({ handle: HANDLE, title: 'Terminal', isActive: true })
@@ -171,12 +155,7 @@ export function sessionScreenTabMountAdapters(
throw new Error(`Unknown tab close action: ${name}`)
},
state: () => ({ terminals, sessionTabs, activeHandle }),
dispose: () => {
for (const timer of timers) {
clearTimeout(timer)
}
hook.unmount()
}
dispose: hook.unmount
}
}
}
@@ -9,33 +9,13 @@ import type {
MobileSessionTabType
} from '../../../session/tabs/mobile-session-tabs'
import type { Terminal } from '../../../terminal/session/mobile-terminal-model'
import type { TuiAgent } from '../../../../../src/shared/agent-launch/catalog/tui-agent'
import { SESSION_TABS_SPLIT_GROUP_PLACEMENT_RUNTIME_CAPABILITY } from '../../../../../src/shared/protocol-version'
const PREVIOUS_HANDLE = 'terminal-0'
const DECLARABLE_AGENTS = ['claude', 'codex'] as const satisfies readonly TuiAgent[]
function declaredAgent(value: unknown): TuiAgent | undefined {
if (value === undefined) {
return undefined
}
const agent = DECLARABLE_AGENTS.find((candidate) => candidate === value)
if (!agent) {
throw new Error(`Unknown agent: ${String(value)}`)
}
return agent
}
// Record unsubscribe choice to catch leaked desktop dimensions; no device subscription runs here.
// Scenario inputs own wire values and omissions: worktree/tab on mount, launch options on create.
// The scheduler pins time/randomness and primes React so mutation ids stay deterministic.
const AGENT_LAUNCH_HOST_CAPABILITIES = [
'agent.launch.v2',
'agent.launch.replay.v1',
'agent.launch.replay-required.v1'
]
export function sessionTerminalCreateMountAdapters(
modules: ReturnType<typeof operationModuleLoader>
): Record<string, MountAdapter> {
@@ -51,7 +31,7 @@ export function sessionTerminalCreateMountAdapters(
let activeHandle: string | null = PREVIOUS_HANDLE
let worktreeId = ''
let activeSessionTabId: string | null = null
let hostCapabilities: string[] = [SESSION_TABS_SPLIT_GROUP_PLACEMENT_RUNTIME_CAPABILITY]
const hostCapabilities = [SESSION_TABS_SPLIT_GROUP_PLACEMENT_RUNTIME_CAPABILITY]
let creating = false
let createError = ''
const terminalsRef = { current: terminals }
@@ -132,42 +112,21 @@ export function sessionTerminalCreateMountAdapters(
activeSessionTabId =
typeof args.activeSessionTabId === 'string' ? args.activeSessionTabId : null
activeSessionTabIdRef.current = activeSessionTabId
hostCapabilities = [
...(args.supportsSplitGroupPlacement === false
? []
: [SESSION_TABS_SPLIT_GROUP_PLACEMENT_RUNTIME_CAPABILITY]),
...(args.agentLaunch === true ? AGENT_LAUNCH_HOST_CAPABILITIES : [])
]
deviceTokenRef.current = typeof args.deviceToken === 'string' ? args.deviceToken : null
return hook.mount()
}
if (name !== 'create') {
throw new Error(`Unknown terminal create action: ${name}`)
}
const agent = declaredAgent(args.agent)
if (
args.startupCommandDelivery !== undefined &&
args.startupCommandDelivery !== 'shell-ready'
) {
throw new Error(`Unknown startup delivery: ${String(args.startupCommandDelivery)}`)
}
// Preserve omitted launch options so bare New Tab reaches the structured-provider branch.
const options = {
...(args.initialPrompt === undefined
? {}
: { initialPrompt: String(args.initialPrompt) }),
...(args.successToast === undefined ? {} : { successToast: String(args.successToast) }),
...(args.errorToast === undefined ? {} : { errorToast: String(args.errorToast) }),
...(args.startupCommand === undefined
? {}
: { startupCommand: String(args.startupCommand) }),
...(args.startupCommandDelivery === undefined
? {}
: { startupCommandDelivery: 'shell-ready' as const }),
...(args.agentPrompt === undefined ? {} : { agentPrompt: String(args.agentPrompt) })
...(args.errorToast === undefined ? {} : { errorToast: String(args.errorToast) })
}
return actions!.handleCreateTerminal(
agent,
undefined,
Object.keys(options).length === 0 ? undefined : options
)
},
@@ -207,26 +207,6 @@ export const OPERATION_MUTATIONS = {
before: ` ...(viewport && next === 'auto' ? { viewport } : {})`,
after: ` ...(next === 'auto' ? { viewport } : {})`
},
// Send null instead of omitting afterTabId; only sessions without an active tab detect it.
'create-after-tab-id-null': {
file: 'use-mobile-session-terminal-create-actions.ts',
before: ' const afterTabId = activeSessionTabId ?? undefined',
after: ' const afterTabId = activeSessionTabId'
},
// Swap shell command and agent prompt; empty-option scenarios cannot detect it.
'create-quick-command-keys': {
file: 'mobile-session-terminal-create-request.ts',
before: ` ...(options?.startupCommand ? { command: options.startupCommand } : {}),
...(options?.startupCommandDelivery
? { startupCommandDelivery: options.startupCommandDelivery }
: {}),
...(options?.agentPrompt ? { agentPrompt: options.agentPrompt } : {}),`,
after: ` ...(options?.startupCommand ? { agentPrompt: options.startupCommand } : {}),
...(options?.startupCommandDelivery
? { startupCommandDelivery: options.startupCommandDelivery }
: {}),
...(options?.agentPrompt ? { command: options.agentPrompt } : {}),`
},
// Remove the in-flight guard; only overlapping taps expose duplicate terminals.
'create-second-tap-in-flight': {
file: 'use-mobile-session-terminal-create-actions.ts',
@@ -14,18 +14,6 @@ describe('last visited worktree repo', () => {
})
describe('readLastVisitedWorktreeRecord', () => {
it('reads absent, truncated, and wrong-shaped payloads as no history', () => {
expect(readLastVisitedWorktreeRecord(null)).toBeNull()
expect(readLastVisitedWorktreeRecord('')).toBeNull()
expect(readLastVisitedWorktreeRecord('{"hostId":"host-1"')).toBeNull()
expect(readLastVisitedWorktreeRecord('null')).toBeNull()
expect(readLastVisitedWorktreeRecord('"a string"')).toBeNull()
expect(readLastVisitedWorktreeRecord(JSON.stringify({ hostId: 'host-1' }))).toBeNull()
expect(
readLastVisitedWorktreeRecord(JSON.stringify({ hostId: 'host-1', worktreeId: 42 }))
).toBeNull()
})
it('rejects empty ids that would build a route to nowhere', () => {
expect(
readLastVisitedWorktreeRecord(JSON.stringify({ hostId: '', worktreeId: 'repo::/wt' }))
@@ -1,23 +1,5 @@
import { describe, expect, it } from 'vitest'
import { buildFilterRepos } from './workspace-filter-repos'
import type { Worktree } from './workspace-list-sections'
function row(worktreeId: string, repoId: string, hostId: Worktree['hostId']): Worktree {
return {
worktreeId,
repoId,
hostId,
repo: 'orca',
branch: 'feature',
displayName: worktreeId,
path: `/tmp/${worktreeId}`,
liveTerminalCount: 0,
hasAttachedPty: false,
unread: false,
isPinned: false,
linkedPR: null
}
}
describe('the repo filter', () => {
it("lists each host's same-named repo separately, by id, as the desktop's filter does", () => {
@@ -49,13 +31,4 @@ describe('the repo filter', () => {
])
expect(repos[0]?.color).toBe('#111111')
})
it('lists the repos the rows name until a catalog answers, still one per repo id', () => {
const repos = buildFilterRepos(
[],
[row('a', 'local-orca', 'local'), row('b', 'm4-orca', 'runtime:m4air')]
)
expect(repos.map((repo) => repo.id)).toEqual(['local-orca', 'm4-orca'])
})
})
@@ -1,9 +1,8 @@
import { NO_WORKSPACE_ROW_FILTERS } from '../../../src/shared/workspace-view/workspace-row-filters'
import { join } from 'node:path'
import { describe, expect, it } from 'vitest'
import { expect, it } from 'vitest'
import type { Worktree } from './workspace-list-sections'
import { NO_PROJECT_SECTION_CATALOG, buildSections } from './workspace-list-sections'
import { DEFAULT_WORKSPACE_STATUSES } from '../../../src/shared/workspace-statuses'
import { buildSections } from './workspace-list-sections'
function worktree(overrides: Partial<Worktree> = {}): Worktree {
const worktreePath = join('/tmp', 'orca', 'worktrees', 'feature')
@@ -26,50 +25,6 @@ function worktree(overrides: Partial<Worktree> = {}): Worktree {
}
}
describe('a pinned parent with an unpinned child', () => {
const parent = worktree({ worktreeId: 'parent', displayName: 'parent', isPinned: true })
const child = worktree({
worktreeId: 'child',
displayName: 'child',
parentWorktreeId: 'parent'
})
function nesting(showPinnedInGroups: boolean) {
const sections = buildSections(
[child, parent],
'name',
{ ...NO_WORKSPACE_ROW_FILTERS },
'',
'repo',
new Set(),
NO_PROJECT_SECTION_CATALOG,
DEFAULT_WORKSPACE_STATUSES,
new Set(),
showPinnedInGroups
)
return sections.map((section) => ({
key: section.key,
rows: section.data.map((item) => [item.row.worktreeId, item.view.lineageDepth])
}))
}
const nested = [
['parent', 0],
['child', 1]
]
it('moves the child into Pinned under its parent by default', () => {
expect(nesting(false)).toEqual([{ key: 'pinned', rows: nested }])
})
it('nests the child under its parent in both sections when the desktop setting is on', () => {
expect(nesting(true)).toEqual([
{ key: 'pinned', rows: nested },
{ key: 'repo:repo-1', rows: nested }
])
})
})
it('follows a pin through a child hidden by search, like desktop', () => {
const root = worktree({ worktreeId: 'root', displayName: 'alpha-root', isPinned: true })
const middle = worktree({
@@ -33,20 +33,6 @@ describe('the other-client filter on an older desktop', () => {
})
describe('applyDesktopViewSettings', () => {
it('applies provided desktop fields and leaves missing ones untouched', () => {
const next = applyDesktopViewSettings(base, {
groupBy: 'pr-status',
hideSleepingWorkspaces: true,
filterRepoIds: ['repo-1']
})
expect(next).toEqual({
...base,
groupBy: 'pr-status',
sharesOtherClientFilter: false,
filters: { ...base.filters, hideSleepingWorkspaces: true, filterRepoIds: ['repo-1'] }
})
})
it("falls back to the desktop's legacy host scope when no host list is saved", () => {
const scoped = applyDesktopViewSettings(base, {
visibleWorkspaceHostIds: null,
+70 -101
View File
@@ -89,26 +89,16 @@ runtime = load_runtime()
class FakeAccessible:
def __init__(self, role, name="", value="", children=(), counter=None):
def __init__(self, role, name="", value="", children=()):
self.role = role
self.name = name
self.value = value
self.children = list(children)
self.counter = counter or {"child_reads": 0}
for child in self.children:
child.use_counter(self.counter)
def use_counter(self, counter):
self.counter = counter
for child in self.children:
child.use_counter(counter)
def get_child_count(self):
self.counter["child_reads"] += 1
return len(self.children)
def get_child_at_index(self, index):
self.counter["child_reads"] += 1
return self.children[index]
def get_role_name(self):
@@ -142,16 +132,6 @@ class FakeAccessible:
return None
class FailingChildrenAccessible(FakeAccessible):
def get_child_count(self):
self.counter["child_reads"] += 1
raise RuntimeError("defunct node")
def render(root):
return runtime.render_accessibility_tree(root, [0])
class SnapshotFixture(ExitStack):
def __init__(self, root, app_name="Fixture"):
super().__init__()
@@ -161,8 +141,6 @@ class SnapshotFixture(ExitStack):
self.clock = 0.0
self.timeout = (800, 15000)
self.delays = {}
self.stalled = []
self.captured_at = None
self.restore = lambda: None
self.bounds = {node: runtime.Rect(100 + i * 10, 200 + i * 20, 300, 400)
for i, node in enumerate(runtime.all_nodes(root))}
@@ -191,13 +169,11 @@ class SnapshotFixture(ExitStack):
delay = self.delays.get(node, 0)
self.clock += min(delay, allowance)
if delay > allowance:
self.stalled.append(node.name)
raise TimeoutError("unresponsive geometry")
return self.bounds.get(node)
def capture(self, bounds):
self.clock += 1
self.captured_at = self.clock
return {"base64": json.dumps(bounds.to_json())} if bounds else None
@@ -293,9 +269,7 @@ class RuntimeRenderTest(unittest.TestCase):
{"name": "already active", "initial": 71, "expected": True, "native": False},
{"name": "delayed AT-SPI focus", "ack": False, "delay": 0.1, "expected": True, "native": False},
{"name": "ineffective true acknowledgment", "ack": True, "expected": True, "native": True},
{"name": "ineffective false acknowledgment", "ack": False, "expected": True, "native": True},
{"name": "unmanaged helper", "ids": "70\n71\n", "managed": [71], "expected": True, "native": True},
{"name": "minimized selected window", "minimized": True, "expected": True, "native": True},
{"name": "two accessible windows", "windows": 2},
{"name": "two native windows", "ids": "72\n71\n"},
{"name": "missing managed stack", "managed": None},
@@ -316,7 +290,7 @@ class RuntimeRenderTest(unittest.TestCase):
def state():
if fixture.clock >= case.get("delay", float("inf")):
active[0] = 71
states = [] if case.get("minimized") else [FakeStateType.SHOWING]
states = [FakeStateType.SHOWING]
if active[0] == 71:
states.append(FakeStateType.ACTIVE)
return FakeStateSet(*states)
@@ -373,7 +347,7 @@ class RuntimeRenderTest(unittest.TestCase):
def test_text_entry_inserts_into_the_focused_field_of_a_background_window(self):
for tool in ("type_text", "paste_text"):
for value in ("there", "élan", "🚀 café"):
for value in ("there", "🚀 café"):
for selection in ((6, 11), None):
field = FakeAccessible("text", "Message", value="Hello world")
field.caret, field.selection = 11, selection
@@ -395,13 +369,8 @@ class RuntimeRenderTest(unittest.TestCase):
cases = [
("not-editable", 1, (6, 11)),
("count-error", TimeoutError("selection timed out"), (6, 11)),
("count-missing", None, (6, 11)),
("count-negative", -1, (6, 11)),
("multiple", 2, (6, 11)),
("range-error", 1, TimeoutError("range timed out")),
("range-missing", 1, None),
("range-empty", 1, (6, 6)),
("range-reversed", 1, (11, 6)),
("range-outside", 1, (6, 12)),
]
for tool in ("type_text", "paste_text"):
@@ -438,30 +407,30 @@ class RuntimeRenderTest(unittest.TestCase):
self.assertEqual((field.value, field.selection), ("Hello world", (6, 11)))
def test_partial_text_replacement_fails_without_typing_again(self):
for tool in ("type_text", "paste_text"):
for failure in (False, True, TimeoutError("provider timed out"), "wrong-range"):
field = FakeAccessible("text", "Message", value="Hello world")
field.caret, field.selection = 11, (6, 11)
field.get_state_set = lambda: FakeStateSet(FakeStateType.FOCUSED, FakeStateType.EDITABLE)
field.get_editable_text_iface = lambda: field
def delete(node, _start, _end):
if failure == "wrong-range":
node.value = node.value[5:]
node.selection = None
return True
if isinstance(failure, Exception):
raise failure
return failure
with self.subTest(tool=tool, failure=failure), SnapshotFixture(
FakeAccessible("frame", "Editor", children=[field])
) as fixture, patch.object(runtime.Atspi.EditableText, "delete_text", delete), \
patch.object(runtime, "type_text") as keys, patch.object(runtime, "paste_text") as paste:
fixture.root.get_state_set = lambda: FakeStateSet(FakeStateType.ACTIVE)
with self.assertRaisesRegex(RuntimeError, "text_replacement_incomplete"):
runtime.run_operation({"tool": tool, "app": "Fixture", "text": "there", "noScreenshot": True})
self.assertEqual(field.value, " worldthere" if failure == "wrong-range" else "Hello worldthere")
keys.assert_not_called()
paste.assert_not_called()
tool = "type_text"
for failure in (False, True, TimeoutError("provider timed out"), "wrong-range"):
field = FakeAccessible("text", "Message", value="Hello world")
field.caret, field.selection = 11, (6, 11)
field.get_state_set = lambda: FakeStateSet(FakeStateType.FOCUSED, FakeStateType.EDITABLE)
field.get_editable_text_iface = lambda: field
def delete(node, _start, _end):
if failure == "wrong-range":
node.value = node.value[5:]
node.selection = None
return True
if isinstance(failure, Exception):
raise failure
return failure
with self.subTest(tool=tool, failure=failure), SnapshotFixture(
FakeAccessible("frame", "Editor", children=[field])
) as fixture, patch.object(runtime.Atspi.EditableText, "delete_text", delete), \
patch.object(runtime, "type_text") as keys, patch.object(runtime, "paste_text") as paste:
fixture.root.get_state_set = lambda: FakeStateSet(FakeStateType.ACTIVE)
with self.assertRaisesRegex(RuntimeError, "text_replacement_incomplete"):
runtime.run_operation({"tool": tool, "app": "Fixture", "text": "there", "noScreenshot": True})
self.assertEqual(field.value, " worldthere" if failure == "wrong-range" else "Hello worldthere")
keys.assert_not_called()
paste.assert_not_called()
def test_unconfirmed_text_insertion_does_not_fall_back_to_another_write(self):
write = FakeEditableText.insert_text
@@ -473,51 +442,51 @@ class RuntimeRenderTest(unittest.TestCase):
"wrong-text": "foobazbar",
"count-unavailable": "foobarbar",
}
for tool in ("type_text", "paste_text"):
for failure, expected in failures.items():
field = FakeAccessible("text", "Message", value="foobar")
field.caret, field.selection = 6, (0, 3)
field.get_state_set = lambda: FakeStateSet(FakeStateType.FOCUSED, FakeStateType.EDITABLE)
field.get_editable_text_iface = lambda: field
def insert(node, position, text, length):
if failure == "no-op":
return True
write(node, position, "baz" if failure == "wrong-text" else text, 1 if failure == "truncated" else length)
if failure == "timeout-after-write":
raise TimeoutError("reply lost after insertion")
return failure != "false-after-write"
def count(node):
return None if failure == "count-unavailable" and node.value != "foobar" else len(node.value)
with self.subTest(tool=tool, failure=failure), SnapshotFixture(
FakeAccessible("frame", "Editor", children=[field])
) as fixture, patch.object(runtime.Atspi.EditableText, "insert_text", side_effect=insert), \
patch.object(runtime.Atspi.Text, "get_character_count", side_effect=count), \
patch.object(runtime, "type_text") as keys, patch.object(runtime, "paste_text") as paste:
fixture.root.get_state_set = lambda: FakeStateSet(FakeStateType.ACTIVE)
with self.assertRaisesRegex(RuntimeError, "text_insertion_unconfirmed"):
runtime.run_operation({"tool": tool, "app": "Fixture", "text": "bar", "noScreenshot": True})
self.assertEqual(field.value, expected)
self.assertEqual(field.selection, (0, 3))
keys.assert_not_called()
paste.assert_not_called()
tool = "type_text"
for failure, expected in failures.items():
field = FakeAccessible("text", "Message", value="foobar")
field.caret, field.selection = 6, (0, 3)
field.get_state_set = lambda: FakeStateSet(FakeStateType.FOCUSED, FakeStateType.EDITABLE)
field.get_editable_text_iface = lambda: field
def insert(node, position, text, length):
if failure == "no-op":
return True
write(node, position, "baz" if failure == "wrong-text" else text, 1 if failure == "truncated" else length)
if failure == "timeout-after-write":
raise TimeoutError("reply lost after insertion")
return failure != "false-after-write"
def count(node):
return None if failure == "count-unavailable" and node.value != "foobar" else len(node.value)
with self.subTest(tool=tool, failure=failure), SnapshotFixture(
FakeAccessible("frame", "Editor", children=[field])
) as fixture, patch.object(runtime.Atspi.EditableText, "insert_text", side_effect=insert), \
patch.object(runtime.Atspi.Text, "get_character_count", side_effect=count), \
patch.object(runtime, "type_text") as keys, patch.object(runtime, "paste_text") as paste:
fixture.root.get_state_set = lambda: FakeStateSet(FakeStateType.ACTIVE)
with self.assertRaisesRegex(RuntimeError, "text_insertion_unconfirmed"):
runtime.run_operation({"tool": tool, "app": "Fixture", "text": "bar", "noScreenshot": True})
self.assertEqual(field.value, expected)
self.assertEqual(field.selection, (0, 3))
keys.assert_not_called()
paste.assert_not_called()
def test_unconfirmed_caret_movement_does_not_report_text_entry_success(self):
for tool in ("type_text", "paste_text"):
for failure in (False, True, TimeoutError("provider timed out")):
field = FakeAccessible("text", "Message", value="Hello world")
field.caret, field.selection = 6, (6, 11)
field.get_state_set = lambda: FakeStateSet(FakeStateType.FOCUSED, FakeStateType.EDITABLE)
field.get_editable_text_iface = lambda: field
with self.subTest(tool=tool, failure=failure), SnapshotFixture(
FakeAccessible("frame", "Editor", children=[field])
) as fixture, patch.object(runtime.Atspi.Text, "set_caret_offset", side_effect=failure if isinstance(failure, Exception) else None, return_value=failure), \
patch.object(runtime, "type_text") as keys, patch.object(runtime, "paste_text") as paste:
fixture.root.get_state_set = lambda: FakeStateSet(FakeStateType.ACTIVE)
with self.assertRaisesRegex(RuntimeError, "text_caret_unconfirmed"):
runtime.run_operation({"tool": tool, "app": "Fixture", "text": "there", "noScreenshot": True})
self.assertEqual((field.value, field.caret), ("Hello there", 6))
keys.assert_not_called()
paste.assert_not_called()
tool = "type_text"
for failure in (False, True, TimeoutError("provider timed out")):
field = FakeAccessible("text", "Message", value="Hello world")
field.caret, field.selection = 6, (6, 11)
field.get_state_set = lambda: FakeStateSet(FakeStateType.FOCUSED, FakeStateType.EDITABLE)
field.get_editable_text_iface = lambda: field
with self.subTest(tool=tool, failure=failure), SnapshotFixture(
FakeAccessible("frame", "Editor", children=[field])
) as fixture, patch.object(runtime.Atspi.Text, "set_caret_offset", side_effect=failure if isinstance(failure, Exception) else None, return_value=failure), \
patch.object(runtime, "type_text") as keys, patch.object(runtime, "paste_text") as paste:
fixture.root.get_state_set = lambda: FakeStateSet(FakeStateType.ACTIVE)
with self.assertRaisesRegex(RuntimeError, "text_caret_unconfirmed"):
runtime.run_operation({"tool": tool, "app": "Fixture", "text": "there", "noScreenshot": True})
self.assertEqual((field.value, field.caret), ("Hello there", 6))
keys.assert_not_called()
paste.assert_not_called()
def test_compacted_browser_records_keep_their_own_frames_and_indexes(self):
tabs = [FakeAccessible("page tab", f"Tab {i}", value="1" if i == 9 else "") for i in range(10)]
+7 -15
View File
@@ -168,22 +168,14 @@ class DataControlServer:
class ClipboardProtocolTests(unittest.TestCase):
def test_both_protocols_preserve_bytes_and_serve_repeated_pastes(self):
def test_preserves_bytes_and_serves_repeated_pastes(self):
text = ("遥か\r\nline two\n" * 20000).encode()
for protocol in ("zwlr_data_control", "ext_data_control"):
with self.subTest(protocol=protocol), DataControlServer(protocol) as server:
self.assertEqual(server.copy(text).returncode, 0)
self.assertEqual(server.paste(), text)
self.assertEqual(server.paste(), text)
server.send(server.source, 1)
self.assertTrue(server.disconnected.wait(1))
def test_unsupported_protocol_never_publishes_or_creates_a_popup(self):
with DataControlServer(None) as server:
result = server.copy(b"private text", {"DISPLAY": ""})
self.assertEqual(result.returncode, 78)
self.assertIsNone(server.source)
self.assertEqual(result.stdout, b"")
with DataControlServer("ext_data_control") as server:
self.assertEqual(server.copy(text).returncode, 0)
self.assertEqual(server.paste(), text)
self.assertEqual(server.paste(), text)
server.send(server.source, 1)
self.assertTrue(server.disconnected.wait(1))
def test_size_limit_precedes_selection_publication(self):
with DataControlServer("ext_data_control") as server:
@@ -6,9 +6,7 @@ import {
mkdtempSync,
readFileSync,
rmSync,
statSync,
symlinkSync,
utimesSync,
writeFileSync
} from 'node:fs'
import { tmpdir } from 'node:os'
@@ -20,7 +18,6 @@ const { getPathMock } = vi.hoisted(() => ({
}))
import { OpenCodeHookService, openCode2HookService } from './hook-service'
import { getOpenCodePluginSource } from './plugin-source/status-plugin-module-source'
import { resolveOpenCodeConfigDirectory } from '../../../shared/opencode-config-directory'
beforeEach(() => {
@@ -69,10 +66,6 @@ describe('OpenCodeHookService buildPtyEnv / clearPty round-trip', () => {
rmSync(join(userDataDir, 'opencode-config-overlays'), { recursive: true, force: true })
})
// OpenCode 2 reloads on mtime changes, resetting status mid-turn.
// OpenCode 2 stats file-level symlink targets used by dotfile managers.
// A service reloading between writes must already find the TUI copy and stand down.
it('writes the TUI copy before the server plugin file', () => {
const pluginsDir = join(resolveOpenCodeConfigDirectory(), 'plugins')
@@ -89,20 +82,6 @@ describe('OpenCodeHookService buildPtyEnv / clearPty round-trip', () => {
rmSync(tuiDir, { recursive: true, force: true })
}
})
it('leaves an up-to-date legacy plugin untouched and never creates the retired dir', () => {
const legacyDir = join(userDataDir, 'opencode-hooks')
new OpenCodeHookService().buildPtyEnv(daemonSessionId)
expect(existsSync(legacyDir)).toBe(false)
const legacyPluginPath = join(legacyDir, 'shared', 'plugins', 'orca-opencode-status.js')
mkdirSync(join(legacyPluginPath, '..'), { recursive: true })
writeFileSync(legacyPluginPath, getOpenCodePluginSource())
const past = new Date('2020-01-01T00:00:00Z')
utimesSync(legacyPluginPath, past, past)
new OpenCodeHookService().buildPtyEnv(daemonSessionId)
expect(statSync(legacyPluginPath).mtimeMs).toBe(past.getTime())
})
})
describe('OpenCodeHookService overlay mode (user OPENCODE_CONFIG_DIR set)', () => {
@@ -1,7 +1,7 @@
import { z } from 'zod'
import { createServer, type ServerResponse } from 'node:http'
import { once } from 'node:events'
import { afterEach, expect, it, vi } from 'vitest'
import { afterEach, expect, it } from 'vitest'
import { runOpenCodeTextTaskSession } from './opencode-text-task-session'
const servers: ReturnType<typeof createServer>[] = []
@@ -79,34 +79,6 @@ it('recovers and deletes an owned session when cancelled during creation without
expect(requests).not.toContain('POST /api/session/ses_late/prompt')
})
it('preserves a completed title when deleting its session fails', async () => {
const warning = vi.spyOn(console, 'warn').mockImplementation(() => {})
const url = await fixture((path, _body, response) => {
if (path.startsWith('POST /session?')) {
json(response, { id: 'ses_cleanup', permission: appliedV1Policy })
} else if (path.startsWith('POST /session/ses_cleanup/message?')) {
json(response, { info: {}, parts: [{ type: 'text', text: 'Harbor Lantern' }] })
} else {
response.writeHead(500).end()
}
})
try {
await expect(
runOpenCodeTextTaskSession({
version: 'v1',
v1SessionPolicyFiltersTools: true,
url,
password: 'test',
directory: '/workspace',
prompt: 'Name this chat',
signal: new AbortController().signal
})
).resolves.toBe('Harbor Lantern')
} finally {
warning.mockRestore()
}
})
it('discards a cancelled borrowed v1 response without aborting or deleting its session', async () => {
const controller = new AbortController()
const submitted = Promise.withResolvers<void>()
-47
View File
@@ -1,47 +0,0 @@
import { describe, expect, it } from 'vitest'
import { buildPiRpcLaunch } from './rpc-launch'
const options = { command: 'host-resolved-pi', cwd: '/host/folder', fullAccess: true }
describe('Pi RPC launch', () => {
it.each([
'/host/.pi/agent/sessions/session.jsonl',
'C:\\Users\\dev\\.pi\\agent\\sessions\\session.jsonl'
])('passes the native session file unchanged: %s', (sessionFile) => {
expect(buildPiRpcLaunch({ ...options, sessionFile }).args).toEqual([
'--mode',
'rpc',
'--session',
sessionFile
])
})
it.each([['--provider', 'anthropic'], ['--provider=anthropic'], ['--model'], ['--model=']])(
'rejects incomplete provider/model args: %j',
(...extraArgs) => {
expect(() => buildPiRpcLaunch({ ...options, extraArgs })).toThrow(/requires/)
}
)
it.each([
'--mode=json',
'--print',
'-p',
'--no-session',
'--session=other',
'--resume',
'--continue'
])('rejects arguments that bypass the chat mode or its session handle: %s', (arg) => {
expect(() => buildPiRpcLaunch({ ...options, extraArgs: [arg] })).toThrow('conflicts')
})
it('rejects a supervised permissions request instead of silently running in full access', () => {
expect(() => buildPiRpcLaunch({ ...options, fullAccess: false })).toThrow('full access only')
})
it('rejects an empty supplied resume handle', () => {
expect(() => buildPiRpcLaunch({ ...options, sessionFile: '' })).toThrow(
'requires a session file'
)
})
})
@@ -1,35 +0,0 @@
import { describe, expect, it, vi } from 'vitest'
import type { AgentJournalMessageItem } from '../../../../shared/agent-session/journal/agent-session-journal-types'
import { PiRpcPromptError, preparePiRpcPrompt } from './rpc-prompt'
const PNG = Buffer.from(
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+/lXcAAAAASUVORK5CYII=',
'base64'
)
function message(blocks: AgentJournalMessageItem['blocks']): AgentJournalMessageItem {
return { kind: 'message', role: 'user', blocks }
}
describe('Pi RPC prompt preparation', () => {
it('rejects URL refs with a typed unsupported attachment failure', async () => {
const readLocal = vi.fn(async () => PNG)
const rejected = await preparePiRpcPrompt(
message([{ type: 'image-ref', url: 'https://example.test/image.png' }]),
undefined,
{ readLocal }
).catch((error: unknown) => error)
expect(rejected).toBeInstanceOf(PiRpcPromptError)
expect(rejected).toMatchObject({
failure: { kind: 'attachmentInvalid', attachment: { reason: 'unsupportedType' } }
})
expect(readLocal).not.toHaveBeenCalled()
})
it('rejects a prompt beyond the RPC writer budget', async () => {
const oversizedText = 'x'.repeat(32 * 1024 * 1024)
await expect(
preparePiRpcPrompt(message([{ type: 'text', text: oversizedText }]))
).rejects.toThrow('RPC write limit')
})
})
@@ -289,29 +289,6 @@ describe('ClientHostedBrowserPagePane failure records across a remount', () => {
})
})
it('keeps a useful local and published identity when the current document clears its title', async () => {
await act(async () => {
render(<StoreDrivenPane />)
})
await act(async () => {
reportClientHostedGuestMetadata({
webContentsId: 42,
kind: 'title',
title: ''
})
})
expect(storedPage()).toMatchObject({
url: 'https://selfsigned.internal/',
title: 'https://selfsigned.internal/'
})
expect(
vi.mocked(window.api.browser.publishClientPageMetadata).mock.calls.at(-1)?.[0].params
).toMatchObject({
url: 'https://selfsigned.internal/',
title: 'https://selfsigned.internal/'
})
})
it('retains the saved title until a first committed document exists, including a failed first load', () => {
reportClientHostedGuestMetadata({
webContentsId: 42,
@@ -340,26 +317,6 @@ describe('ClientHostedBrowserPagePane failure records across a remount', () => {
expect(storedPage().title).toBe('Selfsigned')
})
it('reconciles a hidden commit on settlement even when metadata publication never answers', () => {
vi.mocked(window.api.browser.publishClientPageMetadata).mockImplementation(
() => new Promise(() => {})
)
const view = render(<StoreDrivenPane />)
act(() => view.unmount())
reportClientHostedGuestMetadata({
webContentsId: 42,
kind: 'navigation',
url: 'https://example.internal/next',
loading: true,
navigationRevision: 2
})
render(<StoreDrivenPane />)
act(() => reportClientHostedGuestMetadata({ webContentsId: 42, kind: 'stop', loading: false }))
expect(storedPage().url).toBe('https://example.internal/next')
expect(storedPage().loading).toBe(false)
expect(storedPage().loadError).toBeNull()
})
it('clears a standing failure after a successful same-URL reload', () => {
render(<StoreDrivenPane />)
failLoad()
@@ -41,7 +41,6 @@ import { attachBrowserPageWebview } from './attach-browser-page-webview'
import { useBrowserPageWebviewUrlSync } from '../navigate/use-browser-page-webview-url-sync'
import {
acceptBrowserGuestMetadata,
cachedBrowserGuestMetadata,
clearBrowserGuestMetadata
} from './browser-guest-metadata-cache'
@@ -72,7 +71,7 @@ function nativeState(patch: Partial<BrowserGuestMetadata> = {}): BrowserGuestMet
}
}
function mount(state: BrowserGuestMetadata, initiallyLoading = false) {
function mount(state: BrowserGuestMetadata) {
const ref = <T>(current: T) => ({ current })
const first: BrowserPage = {
id: 'page-a',
@@ -80,7 +79,7 @@ function mount(state: BrowserGuestMetadata, initiallyLoading = false) {
worktreeId: 'worktree-a',
url: 'https://example.test/attempted',
title: 'Saved title',
loading: initiallyLoading,
loading: false,
faviconUrl: null,
canGoBack: true,
canGoForward: false,
@@ -296,77 +295,4 @@ describe('mounted browser metadata application', () => {
disposers.push(dispose)
expect(view.page().title).toBe('https://kagi.com/search?q=orca')
})
it('keeps the saved title before the first document commits', () => {
const view = mount(nativeState({ navigationRevision: 0, url: '', title: '', loading: true }))
expect(view.page().title).toBe('Saved title')
expect(view.page().loading).toBe(true)
acceptBrowserGuestMetadata(
nativeState({
revision: 2,
navigationRevision: 0,
kind: 'start',
url: '',
title: '',
loading: true
})
)
expect(view.page().title).toBe('Saved title')
acceptBrowserGuestMetadata(
nativeState({
revision: 3,
navigationRevision: 0,
kind: 'stop',
url: '',
title: '',
loading: false
})
)
expect(view.page().title).toBe('Saved title')
expect(view.page().url).toBe('https://example.test/attempted')
expect(view.page().loading).toBe(false)
})
it('adopts a document that predates observation while native loading and saved loading are true', () => {
const view = mount(
nativeState({
navigationRevision: 0,
url: 'https://current.test/c',
title: 'Current C',
loading: true
}),
true
)
expect(view.page()).toMatchObject({
url: 'https://current.test/c',
title: 'Current C',
loading: true
})
})
it('reattaches a failed destination without replacing its address or clearing its certificate challenge', () => {
const loadError = {
code: -202,
description: 'ERR_CERT_AUTHORITY_INVALID',
validatedUrl: 'https://example.test/attempted'
}
const view = mount(nativeState({ loadError, hasCertificateFailure: true }))
expect(view.setUrl).not.toHaveBeenCalled()
expect(view.address).not.toHaveBeenCalled()
expect(view.page().url).toBe('https://example.test/attempted')
expect(view.page().loadError).toEqual(loadError)
expect(view.page().canGoBack).toBe(true)
})
it('keeps parked titles out of saved page state and restores the current title on reattach', () => {
const view = mount(nativeState())
acceptBrowserGuestMetadata(nativeState({ revision: 2, kind: 'title', title: 'Next title' }))
expect(view.page().title).toBe('Next title')
view.dispose()
acceptBrowserGuestMetadata(nativeState({ revision: 3, kind: 'title', title: 'Parked title' }))
expect(view.page().title).toBe('Next title')
expect(cachedBrowserGuestMetadata(view.webview)?.title).toBe('Parked title')
const reattached = mount(nativeState({ revision: 4, title: 'Parked title' }))
expect(reattached.page().title).toBe('Parked title')
})
})
@@ -1,20 +0,0 @@
import { describe, expect, it } from 'vitest'
import { getPinchZoomFactor } from './image-viewer-zoom'
describe('image viewer zoom helpers', () => {
it('normalizes line and page wheel delta modes', () => {
const pixelFactor = getPinchZoomFactor(1, 0)
const lineFactor = getPinchZoomFactor(1, 1)
const pageFactor = getPinchZoomFactor(1, 2)
expect(lineFactor).toBeLessThan(pixelFactor)
expect(pageFactor).toBeLessThan(lineFactor)
})
it('bounds very large per-event zoom factors', () => {
expect(getPinchZoomFactor(-10_000, 0)).toBeCloseTo(getPinchZoomFactor(-100, 0))
expect(getPinchZoomFactor(10_000, 0)).toBeCloseTo(getPinchZoomFactor(100, 0))
expect(getPinchZoomFactor(-10_000, 0)).toBeLessThan(2)
expect(getPinchZoomFactor(10_000, 0)).toBeGreaterThan(0.5)
})
})
@@ -1,34 +0,0 @@
import { describe, expect, it } from 'vitest'
import { getDefaultVoiceSettings } from '../../../../shared/constants'
import type { GlobalSettings } from '../../../../shared/global-settings-types'
import { getFeatureTipForModal } from './feature-tip-modal-state'
// Session search defaults on so tests about the older tips don't see the session-search tip first.
function makeSettings(
voiceEnabled = false,
sessionSearchEnabled = true
): Pick<GlobalSettings, 'voice' | 'aiVaultSearch'> {
return {
voice: {
...getDefaultVoiceSettings(),
enabled: voiceEnabled
},
aiVaultSearch: { enabled: sessionSearchEnabled, historyDays: null }
}
}
describe('feature tip modal state', () => {
it('keeps rendering the opened tip after app open has marked it seen', () => {
const tip = getFeatureTipForModal({
cliInstalled: false,
modalData: { tipId: 'voice-dictation' },
seenTipIds: ['voice-dictation'],
featureInteractions: {},
chatUiLaunchTipVariant: 'none',
settings: makeSettings(),
webClient: false
})
expect(tip?.id).toBe('voice-dictation')
})
})
@@ -1,30 +0,0 @@
import { afterEach, describe, expect, it, vi } from 'vitest'
vi.mock('@/i18n/i18n', () => ({
translate: (_key: string, fallback: string) => fallback
}))
import { reloadOrcaRenderer } from './GhAuthErrorHelp'
afterEach(() => {
vi.restoreAllMocks()
vi.unstubAllGlobals()
})
describe('GitHub Project auth remediation host routing', () => {
it('does not force navigation when the checkpointed reload is refused', async () => {
const reload = vi.fn(() => Promise.reject(new Error('checkpoint failed')))
const locationReload = vi.fn()
const errors = vi.spyOn(console, 'error').mockImplementation(() => {})
vi.stubGlobal('window', {
api: { app: { reload } },
location: { reload: locationReload }
})
reloadOrcaRenderer()
await vi.waitFor(() => expect(errors).toHaveBeenCalledTimes(1))
expect(reload).toHaveBeenCalledTimes(1)
expect(locationReload).not.toHaveBeenCalled()
})
})
@@ -1,8 +0,0 @@
import { expect, it } from 'vitest'
import { shouldRenderCommitArea } from './component-gates'
it('keeps manual revert completion available until sequencer recovery is supported', () => {
expect(shouldRenderCommitArea(0, 'revert', false)).toBe(true)
expect(shouldRenderCommitArea(0, 'revert', true)).toBe(false)
expect(shouldRenderCommitArea(1, 'revert', false)).toBe(false)
})
@@ -21,20 +21,6 @@ const wide: GitHistoryItemViewModel = {
kind: 'node'
}
it('keeps boundary strokes and restores full geometry when the graph column widens', () => {
const narrow = paths(draw(wide, 132))
expect(narrow).toContain('M 132 0 V 24')
expect(narrow).not.toContain('M 143 0 V 24')
expect(narrow).toContain('M 11 0 V 12')
expect(narrow).toContain('M 11 12 V 24')
const full = draw(wide)
expect(paths(draw(wide, 300))).toEqual(paths(full))
expect(paths(full)).toContain('M 264 0 V 24')
expect(paths(draw(wide, 132))).toEqual(narrow)
expect(full.querySelector('svg')?.getAttribute('viewBox')).toBe('0 0 275 24')
expect(draw(wide, 132).querySelector('svg')?.getAttribute('width')).toBe('275')
})
it('preserves converging arcs whose strokes enter the graph column', () => {
const view: GitHistoryItemViewModel = {
...wide,
@@ -1,31 +0,0 @@
import { describe, expect, it } from 'vitest'
import {
SHORTCUT_LOCAL_SEARCH_QUERY_MAX_BYTES,
isShortcutLocalSearchQueryTooLarge,
matchesShortcutLocalSearch,
normalizeShortcutLocalSearchQuery,
type ShortcutRowModel
} from './ShortcutFilterRail'
describe('ShortcutFilterRail search helpers', () => {
it('rejects oversized pasted shortcut searches before reading row metadata', () => {
const oversizedQuery = 'secret-shortcut-search'.repeat(SHORTCUT_LOCAL_SEARCH_QUERY_MAX_BYTES)
const row = {
get item(): ShortcutRowModel['item'] {
throw new Error('oversized shortcut searches must not scan shortcut metadata')
},
get groupTitle(): string {
throw new Error('oversized shortcut searches must not scan shortcut groups')
},
get effective(): readonly string[] {
throw new Error('oversized shortcut searches must not format keybindings')
},
modified: false,
warnings: []
} as ShortcutRowModel
expect(isShortcutLocalSearchQueryTooLarge(oversizedQuery)).toBe(true)
expect(normalizeShortcutLocalSearchQuery(oversizedQuery)).toBeNull()
expect(matchesShortcutLocalSearch(row, oversizedQuery, 'win32')).toBe(false)
})
})